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
465511357
import redmine from redmine import Redmine from typing import List, Set, Sequence, Dict from collections import defaultdict, OrderedDict from redmine.resources import Issue, Note from copy import deepcopy from pprint import pprint import os, sys, pathlib import mistune from pygments import highlight from pygments.util...
null
redminer/__main__.py
__main__.py
py
3,626
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "mistune.Renderer", "line_number": 24, "usage_type": "attribute" }, { "api_name": "mistune.escape", "line_number": 30, "usage_type": "call" }, { "api_name": "pygments.lexers.get...
347003576
"""Utilities for unit testing and sanity checking estimators.""" import copy import functools import math import pickle import random import numpy as np __all__ = ['check_estimator'] def yield_datasets(model): from river import compose from river import datasets from river import preprocessing fro...
null
river/utils/estimator_checks.py
estimator_checks.py
py
6,732
python
en
code
null
code-starcoder2
76
[ { "api_name": "river.utils.inspect.ismoregressor", "line_number": 24, "usage_type": "call" }, { "api_name": "river.utils.inspect", "line_number": 24, "usage_type": "attribute" }, { "api_name": "river.utils", "line_number": 24, "usage_type": "name" }, { "api_name":...
62381046
# -*- coding=utf-8 -*- from django.conf import settings from models import * from agents import get_uc_internal_domain_list from utils import * import logging import sys logger = logging.getLogger(__name__) def class_name_to_class(model_cls_name): model_cls = getattr(sys.modules[__name__], model_cls_...
null
applications/user_center/sync.py
sync.py
py
3,359
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.modules", "line_number": 13, "usage_type": "attribute" }, { "api_name": "agents.get_uc_internal_domain_list", "line_number": 45, "usage_type": "call" }, { "api_name": "...
532542807
# Copyright 2016 The TensorFlow Authors. 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 applica...
null
slim/datasets/convert_deepfashion.py
convert_deepfashion.py
py
7,570
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.placeholder", "line_number": 51, "usage_type": "call" }, { "api_name": "tensorflow.string", "line_number": 51, "usage_type": "attribute" }, { "api_name": "tensorflow.image.decode_jpeg", "line_number": 52, "usage_type": "call" }, { "api_na...
255598573
import os from tensorflow.keras.preprocessing import image import matplotlib.pyplot as plt import numpy as np from tensorflow.keras.utils import to_categorical import random,shutil from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dropout,Conv2D,Flatten,Dense, MaxPooling2D, Batc...
null
model.py
model.py
py
2,501
python
en
code
null
code-starcoder2
76
[ { "api_name": "google.colab.drive.mount", "line_number": 13, "usage_type": "call" }, { "api_name": "google.colab.drive", "line_number": 13, "usage_type": "name" }, { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 15, "usage_type": "call" }, ...
270496292
# Implementation of 2nd in "Byzantine-Resistant Total Ordering Algorithms" by Louise E. Moser and P. M. Melliar-Smith # Only Byzantine nodes are supposed. Hence k_c = 0, N_d = N_v > 2/3 * N, N_v > 1/3 * N import datetime import os import collections import matplotlib.pyplot as plt from src.gnode import GenericNode i...
null
src/node21.py
node21.py
py
12,363
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.DE...
285309528
from flask import render_template, request, redirect, url_for,abort from flask_login import login_required from . import main from ..models import Comment, User, Post from .forms import CommentForm, UpdateProfile, PostForm from flask_login import login_required,current_user from ..import db,photos @main.route("/",met...
null
app/main/views.py
views.py
py
2,846
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Post.query.filter_by", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Post.query", "line_number": 19, "usage_type": "attribute" }, { "api_name...
275756807
# -*- coding: utf-8 -*- # # This file is part of hepcrawl. # Copyright (C) 2016, 2017 CERN. # # hepcrawl is a free software; you can redistribute it and/or modify it # under the terms of the Revised BSD License; see LICENSE file for # more details. """Spider for MAGIC.""" from __future__ import absolute_import, divis...
null
hepcrawl/spiders/magic_spider.py
magic_spider.py
py
6,414
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.spiders.XMLFeedSpider", "line_number": 27, "usage_type": "name" }, { "api_name": "scrapy.Request", "line_number": 67, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 70, "usage_type": "call" }, { "api_name": "utils.spli...
481444348
import numpy as np import os import sys sys.path.append('/home/ng213/code/sharpy/') import matplotlib.pyplot as plt import sharpy.linear.src.libsparse as libsp import scipy.linalg as sclalg import scipy as sc import sharpy.linear.src.lin_aeroelastic as linaeroelastic import sharpy.linear.src.libss as libss import case...
null
07_RigidBodyModes/02_IndividualAeroelasticModes/individual_modes.py
individual_modes.py
py
18,194
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 45, "usage_type": "call" }, { "api_name": "os.system", "line_number"...
71299950
import psutil import os import base64 import gzip import glob from StringIO import StringIO import platform import subprocess import robot.variables from robot.api import logger from cryptography import Cryptography from src.mock.server.defaults import Config import random from collections import defaultdict __author_...
null
src/utils/Utilities.py
Utilities.py
py
15,652
python
en
code
null
code-starcoder2
76
[ { "api_name": "platform.system", "line_number": 18, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 20, "usage_type": "call" }, { "api_name": "windows.Utilities.Utilities", "line_number": 40, "usage_type": "call" }, { "api_name": "platform....
573779823
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 4 00:25:04 2018 @author: stutishukla """ import math import cv2 import numpy as np import matplotlib.pyplot as plt img = cv2.imread("/Users/stutishukla/Downloads/proj1_cse573/task2.jpg", cv2.IMREAD_GRAYSCALE) a=np.asarray(img) def getDimensionsO...
null
Project1/Task2/gauss3.py
gauss3.py
py
10,419
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.asarray", ...
312919690
from django.conf import settings from django.shortcuts import redirect, render from django.http import HttpResponse from django.template import loader from appMisEstacionamientos.forms.loginForms import LoginForm from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators impor...
null
misEstacionamientos/appMisEstacionamientos/views/loginView.py
loginView.py
py
1,748
python
en
code
null
code-starcoder2
76
[ { "api_name": "appMisEstacionamientos.forms.loginForms.LoginForm", "line_number": 13, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 16, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 19, "usage_...
417697651
#! /usr/bin/python # -*- coding: utf8 -*- from common.brower_select import Brower_Select import unittest import time import os from common.logger import Logger from common import login # from src.test.common.my_brower import My_bower mylogger = Logger(logger='RunTest').getlog() class TestLogin(unittest.TestCase): ...
null
MZ/src/test/caseinfo/runbower.py
runbower.py
py
1,529
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.logger.Logger", "line_number": 12, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "common.brower_select.Brower_Select", "line_number": 16, "usage_type": "call" }, { "ap...
634635590
from rest_framework import generics,mixins from .models import URL from .serializers import URLCreateSerializer from rest_framework.views import APIView from rest_framework import permissions from rest_framework.response import Response from .extractor import get_features from .final_prediction import pred import math ...
null
urlshortner/shortner/views_api.py
views_api.py
py
1,717
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 11, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 11, "usage_type": "name" }, { "api_name": "serializers.URLCreateSerializer", "line_number": 13, "usage_type": "na...
205530125
# -*- coding: utf-8 -*- ############################################################################### # Author: Nicolas Pécheux <nicolas.pecheux@limsi.fr> # 20, October 2012 # Information Retrieval Project - Paris Diderot ############################################################################### """A class fo...
null
project/src/database.py
database.py
py
3,379
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 95, "usage_type": "call" } ]
141414119
import gzip from io import BytesIO from flask import current_app as app from flask import redirect from flask import render_template as rt from flask import request, send_from_directory, url_for from htmlmin.main import minify from . import __version__ @app.route("/") def create(): """View to create a secret.""...
null
shhh/views.py
views.py
py
1,825
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.render_template", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.current_app.route", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.current_app", "line_number": 13, "usage_type": "name" }, { "api_name": "flask...
95085
#!/usr/bin/env python3 ''' Class to play audio files, randomly, from subfolders ''' import random import glob import pygame import logging resource_dir = "resources/" warn_short_dir = resource_dir + "warn-short/" warn_long_dir = resource_dir + "warn-long/" reward_dir = resource_dir + "reward/" pygame.mixer.init() ...
null
soundbox.py
soundbox.py
py
1,070
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.mixer.init", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 16, "usage_type": "attribute" }, { "api_name": "random.choice", "line_number": 35, "usage_type": "call" }, { "api_name": "glob.glob", "li...
480867613
import numpy as np import torch import torch.nn.functional as F import data import math def mask_x(x, max_len = 11): # b句话,每句话11个词,这里是还没embed的 # x = [b, 11] # 判断每个词是不是<PAD> # 在数字化文本进行掩码表示,在字典中为<PAD>的进行掩饰, result:[true,false, ....] mask = x == data.zidian['<PAD>'] # [b, 11] -> [b, 1, 1, 11] ...
null
Version_5/transformer_attention/transformer_demo_green/Utils.py
Utils.py
py
3,071
python
en
code
null
code-starcoder2
76
[ { "api_name": "data.zidian", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.triu", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.ones", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.long", "line_number"...
42895400
"""core URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based ...
null
urls.py
urls.py
py
1,601
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 24, "usage_type": "call" }, { "api_name": "login.views.webhome", "line_number": 24, "usage_type": "attribute" }, { "api_name": "login.views", "line_number": 24, "usage_type": "name" }, { "api_name": "django.conf...
370387978
from functools import lru_cache @lru_cache(maxsize=None) def allStrs(alpha, length): if length == 0: return [''] else: result = [] for a in alpha: for rest in allStrs(alpha, length - 1): result.append((a + rest)) return result def allPalsLenN(n, al...
null
misc/find_number.py
find_number.py
py
1,351
python
en
code
null
code-starcoder2
76
[ { "api_name": "functools.lru_cache", "line_number": 4, "usage_type": "call" } ]
546140772
import sys import os import re from pathlib import Path from contextlib import contextmanager from tempfile import NamedTemporaryFile import waitress import flask from werkzeug.wsgi import responder, FileWrapper from werkzeug.wrappers import Request from paste.cgiapp import CGIApplication from globus_sdk import (Na...
null
lfs.py
lfs.py
py
12,340
python
en
code
null
code-starcoder2
76
[ { "api_name": "tempfile.NamedTemporaryFile", "line_number": 64, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 67, "usage_type": "call" }, { "api_name": "contextlib.contextmanager", "line_number": 40, "usage_type": "name" }, { "api_name": "pa...
68589714
from os.path import basename as _basename form_name=_basename(__file__).split('.')[0].split('_')[-1] is_form = { 'dcd': form_name, 'DCD': form_name } def to_mdtraj(item, topology=None, selection=None, syntaxis="mdtraj"): if not topology: raise ValueError('"topology" argument is required for ...
null
molmodmt/forms/files/api_dcd.py
api_dcd.py
py
904
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.basename", "line_number": 3, "usage_type": "call" }, { "api_name": "molmodmt.convert", "line_number": 17, "usage_type": "call" }, { "api_name": "mdtraj.load_dcd", "line_number": 18, "usage_type": "call" }, { "api_name": "mdtraj.load_dcd", ...
603549622
import requests class RequestSpider: def __init__(self): url = 'https://www.baidu.com' headers = {"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"} self.response = requests.get(url, header...
null
爬虫test/test.py
test.py
py
1,224
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" } ]
245078273
import sys import array import dbus, dbus.mainloop.glib from gi.repository import GLib from classesDefinitions import Advertisement from classesDefinitions import register_ad_cb, register_ad_error_cb from classesDefinitions import Service, Characteristic from pprint import PrettyPrinter import time prettyPrint = Pret...
null
garbageFiles/serverBluetoothSettings.py
serverBluetoothSettings.py
py
7,803
python
en
code
null
code-starcoder2
76
[ { "api_name": "pprint.PrettyPrinter", "line_number": 12, "usage_type": "call" }, { "api_name": "classesDefinitions.Characteristic", "line_number": 31, "usage_type": "name" }, { "api_name": "classesDefinitions.Characteristic.__init__", "line_number": 39, "usage_type": "cal...
489047596
import torch from torchvision import datasets, transforms import numpy as np class MNIST(object): def __init__(self, data_dir='~/data/mnist', cuda=False, num_workers=4, batch_size=64, shuffle=True): gpu_conf = { ...
null
data.py
data.py
py
4,073
python
en
code
null
code-starcoder2
76
[ { "api_name": "torchvision.transforms.Compose", "line_number": 17, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 17, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 18, "usage_type": "call" }, { ...
514929792
import boto3 from moto import mock_s3 from moto import mock_sts from security_monkey.watchers.s3 import S3 from ..datastore import Account, Technology, Item, ExceptionLogs, AccountType from . import SecurityMonkeyTestCase, db class S3TestCase(SecurityMonkeyTestCase): def pre_test_setup(self): account_typ...
null
security_monkey/tests/test_s3.py
test_s3.py
py
1,901
python
en
code
null
code-starcoder2
76
[ { "api_name": "datastore.AccountType.query.filter", "line_number": 12, "usage_type": "call" }, { "api_name": "datastore.AccountType.query", "line_number": 12, "usage_type": "attribute" }, { "api_name": "datastore.AccountType", "line_number": 12, "usage_type": "name" }, ...
211287156
import numpy as np from math import exp import matplotlib.pyplot as plt cov_cal = lambda X,Y,sigma: np.array([exp(-(x-y)**2/2/sigma**2) for x in X for y in Y]).reshape(len(X),len(Y)) def posterior_GP(X,X_train,y_train,sigma): cov_given = cov_cal(X_train,X_train,sigma) cov_X = cov_...
null
EECS-545-Machine-Learning/homework2/prob4.py
prob4.py
py
1,268
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.linalg.inv", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number":...
449173402
# -*- encoding: utf-8 -*- from __future__ import absolute_import from functools import partial from django.db.models.query import QuerySet, ValuesQuerySet from django.db.models.query_utils import Q from . import settings from .deletion import PermanentCollector class PermanentQuerySet(QuerySet): def get_resto...
null
django_permanent/query.py
query.py
py
3,006
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.query.QuerySet", "line_number": 14, "usage_type": "name" }, { "api_name": "functools.partial", "line_number": 21, "usage_type": "call" }, { "api_name": "deletion.PermanentCollector", "line_number": 49, "usage_type": "call" }, { "api...
491497924
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import matplotlib.pyplot as plt import pandas as pd from matplotlib.font_manager import FontProperties from scipy import integrate from scipy import special from scipy import signal, interpolate import constnumberfile as cn from numba import jit impo...
null
functionfilerevision.py
functionfilerevision.py
py
8,903
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.run", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.expand_dims", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.expand_dims", "line_number": 29, "usage_type": "call" }, { "api_name": "constnumberfile.ob...
16139064
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import logging import pytest from django.core.urlresolvers import reverse from django.forms import model_to_dict from django_dynamic_fixture import G from rest_framework.test import APIClient from strategy_field.utils import ...
null
tests/test_viewset.py
test_viewset.py
py
3,115
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "django_dynamic_fixture.G", "line_number": 27, "usage_type": "call" }, { "api_name": "django_dynamicfields.models.CustomFieldDefs.objects.add_to_model", "line_number": 28, "usage_t...
8919803
import unpaddedbase64 from Crypto.Cipher import AES from Crypto.Util import Counter from Crypto import Random from Crypto.Hash import SHA256 def encrypt_attachment(plaintext): """Encrypt a plaintext in order to send it as an encrypted attachment. Args: plaintext (bytes): The data to encrypt. Ret...
null
libs/matrix_client/matrix_client/crypto/encrypt_attachments.py
encrypt_attachments.py
py
2,456
python
en
code
null
code-starcoder2
76
[ { "api_name": "Crypto.Random.new", "line_number": 23, "usage_type": "call" }, { "api_name": "Crypto.Random", "line_number": 23, "usage_type": "name" }, { "api_name": "Crypto.Util.Counter.new", "line_number": 25, "usage_type": "call" }, { "api_name": "Crypto.Util.C...
620386072
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
null
docs/conf.py
conf.py
py
4,776
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.mock.MagicMock", "line_number": 51, "usage_type": "attribute" }, { "api_name": "unittest.mock", "line_number": 51, "usage_type": "name" }, { "api_name": "unittest.mock.MagicMock", "line_number": 54, "usage_type": "call" }, { "api_name": "un...
493817651
import getpass import json import requests import urllib import csv class Robinhood: endpoints = { "login": "https://api.robinhood.com/api-token-auth/", "investment_profile": "https://api.robinhood.com/user/investment_profile/", "accounts":"https://api.robinhood.com/accounts/"...
null
Robinhood.py
Robinhood.py
py
13,269
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.session", "line_number": 52, "usage_type": "call" }, { "api_name": "urllib.request.getproxies", "line_number": 53, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 53, "usage_type": "attribute" }, { "api_name": "getpas...
263131847
from pyspark import SparkContext from pyspark.streaming import StreamingContext from pyspark.sql import SparkSession, Row, SQLContext from pyspark.sql.functions import * from pyspark.sql.types import * from pyspark.streaming.kafka import KafkaUtils from configparser import ConfigParser import json from kafka import Kaf...
null
spark/streamSensors.py
streamSensors.py
py
4,743
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.ConfigParser", "line_number": 12, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.config", "line_number": 24, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 24, "usage_type": "at...
291485994
from django.conf.urls import patterns, url urlpatterns = patterns("cartridge.shop.views", url("^product/(?P<slug>.*)/$", "product", name="shop_product"), url("^wishlist/$", "wishlist", name="shop_wishlist"), url("^cart/$", "cart", name="shop_cart"), url("^checkout/$", "checkout_steps", name="shop_chec...
null
cartridge/shop/urls.py
urls.py
py
470
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 4, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "djan...
446213256
# Copyright (C) 2020 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ Assessment generator hooks We are applying assessment template properties and make new relationships and custom attributes """ from datetime import datetime import collections import itertools im...
null
src/ggrc/models/hooks/assessment.py
assessment.py
py
20,006
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "ggrc.utils.referenced_objects.get", "line_number": 65, "usage_type": "call" }, { "api_name": "ggrc.utils.referenced_objects", "line_number": 65, "usage_type": "name" }, { ...
117840911
from random import randint from time import sleep import pandas as pd import pytest from cognite.client import CogniteClient from cognite.client.stable.time_series import TimeSeries, TimeSeriesListResponse, TimeSeriesResponse timeseries = CogniteClient().time_series @pytest.fixture(autouse=True, scope="class") def...
null
tests/test_stable/test_timeseries.py
test_timeseries.py
py
2,548
python
en
code
null
code-starcoder2
76
[ { "api_name": "cognite.client.CogniteClient", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "call" }, { "api_name": "cognite.cl...
73838873
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Sep 29 16:23:33 2018 @author: natalie """ import boto3 import pandas as pd import numpy as np import matplotlib.pyplot as plt from mlxtend.preprocessing import TransactionEncoder import random from mlxtend.frequent_patterns import apriori import pyfpgr...
null
Archive/Growth_test_AWS2.py
Growth_test_AWS2.py
py
11,836
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.client", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "lin...
53008665
# -*- coding: utf-8 -*- """ Created on Wed Nov 11 15:52:52 2015 @author: banano """ import numpy as np import h5py import matplotlib.pyplot as plt from numpy.linalg import eigvalsh, eigh from math import floor # h5 filename to capture the results of this simulation #Functions that generate Floquet matrix and find...
null
Molmer/MolmerFloquet.py
MolmerFloquet.py
py
3,689
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sqrt", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number"...
191866372
''' Created on Feb 23, 2016 @author: Max Ruiz ''' import math import random #import analytics from analytics import average_nearest_neighbor_distance from point import Point def g_function(pointsArr, d): gPrime = 0 for x in pointsArr: shrtDist = 100000 for y in pointsArr: if x == ...
null
utils.py
utils.py
py
4,403
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.seed", "line_number": 30, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 33, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 34, "usage_type": "call" }, { "api_name": "point.Point", "line_num...
354475050
import numpy as np import os import pickle import csv import datetime as dt import feature_extraction_helper as feh from scipy.signal import medfilt def preprocess_data(char_set,input_case=["all"],log_buffer=dt.timedelta(seconds=1)): """ Arguments: char_set: set of characters for which input has to be cons...
null
Code/data_processing.py
data_processing.py
py
15,613
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.timedelta", "line_number": 9, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 33, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 34, "usage_type": "call" }, { "api_name": "os.listdir", "line_number...
386829895
import os import pandas as pd from imblearn.under_sampling import RandomUnderSampler from contextlib import contextmanager import psutil import time @contextmanager def timer_memory(name): t0 = time.time() yield print( f'Memory: {(psutil.Process(os.getpid()).memory_info().rss/2**30):.02f}GB') ...
null
1.undersampling.py
1.undersampling.py
py
1,242
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "psutil.Process", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 15, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16,...
531089033
# -*- coding: utf-8 -*- """Application setup script""" import os from setuptools import setup, find_packages def read(path): """Return file contents.""" with open(path) as file_object: return file_object.read() # allow setup.py to be run from any path os.chdir(os.path.dirname(os.path.abspath(__file...
null
setup.py
setup.py
py
788
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 15, "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.abspath", "line_num...
438554681
import cv2 import numpy as np import matplotlib.pyplot as plt # # img = cv2.imread('C:/Users/cliff/PycharmProjects/pinDetect/image1.jpg', cv2.IMREAD_GRAYSCALE) #img = cv2.imread('C:/Users/cliff/PycharmProjects/pinDetect/image1.jpg', cv2.COLOR_BGR2GRAY) # img = cv2.imread('C:/Users/cliff/PycharmProjects/pinDetect/...
null
BaseTests1.py
BaseTests1.py
py
1,226
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.array", "line...
86545887
from auth.decorators import authanticate from auth.dao import photographer_profile from auth.dao.photographer_profile import PhotographerPortfolioDao, PhotographerPorfileDao from query.models import Address from database_connection.decorator import atomic_tarnsaction from exceptions.dao_exceptions import DaoExceptionEr...
null
auth/services/photographer_profile.py
photographer_profile.py
py
4,171
python
en
code
null
code-starcoder2
76
[ { "api_name": "auth.dao.photographer_profile.PhotographerPortfolioDao", "line_number": 16, "usage_type": "call" }, { "api_name": "auth.dao.photographer_profile.PhotographerPortfolioDao", "line_number": 26, "usage_type": "call" }, { "api_name": "utils.s3_upload.AWSFileUpload", ...
316053131
"""empty message Revision ID: d6ff2681e5a8 Revises: Create Date: 2020-02-23 17:44:58.581923 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'd6ff2681e5a8' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
null
migrations/versions/d6ff2681e5a8_.py
d6ff2681e5a8_.py
py
4,573
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
14773915
import logging from . import * TDebug = Type("Debug") def op_debug(c: AF_Continuation) -> None: c.stack.push(StackObject(value="Debug",stype=TDebug)) Type.register_ctor('Debug',Operation('debug',op_debug),[StackObject(stype=TAny)]) make_word_context('debug', op_debug, [], [TDebug]) def op_on(c: AF_Continuation)...
null
src/af_types/af_debug.py
af_debug.py
py
746
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.DEBUG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.WARNI...
452153319
import numpy as np import matplotlib.pyplot as plt W1 = np.loadtxt('weights1AE.txt') temp = np.empty((150, 784)) for i in range(150): temp[i] = W1[:,i] grayscale = np.empty((150,28,28)) for j in range(150): for i in range(784): grayscale[j][i // 28][i % 28] = temp[j][i] fig, axs = plt.subplots(10, ...
null
homework3/plotFeatures.py
plotFeatures.py
py
491
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.loadtxt", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", ...
286563671
#!/usr/bin/env python # -*- coding: utf8 -*- try: import unittest2 as unittest except ImportError: import unittest import agate import agatesql from sqlalchemy import create_engine agatesql.patch() class TestSQL(unittest.TestCase): def setUp(self): self.rows = ( (1, 'a'), ...
null
tests/test_agatesql.py
test_agatesql.py
py
1,257
python
en
code
null
code-starcoder2
76
[ { "api_name": "agatesql.patch", "line_number": 13, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "agate.Number", "line_number": 23, "usage_type": "call" }, { "api_name": "agate.Text", "...
203918659
# coding: utf-8 # # Portfolio payoff routines # # These routines take a portfolio of call and put options and plots the payoff functions. # In[ ]: import matplotlib.pyplot as plt import numpy as np def get_beta(beta, x): if x in beta: return beta[x] else: return 1.0 def scale (prices, ...
null
web/home/ipython/examples/portfolio.py
portfolio.py
py
4,183
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.vectorize", "line_number": 66, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 67, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
487393376
from PyQt5.QtWidgets import QApplication, QWidget, QInputDialog, QLineEdit, QFileDialog , QPushButton,QMessageBox from PyQt5 import QtWidgets, QtCore,QtGui,uic,QtMultimedia from mainwindow import Ui_MainWindow from ImageClass import image #Importing class from another python file import matplotlib.pyplot as plot from...
null
main.py
main.py
py
9,868
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "PyQt5.QtWidg...
455974546
from io import BytesIO import requests from PIL import Image class GoogleStaticMapParser(): def GetString(self, data): address = data["call_address"] address_parts = address.split(" ") address_parts = address_parts + [data["call_city"], "RI", data["call_zip"]] string1 = "http://maps.googleapis.com/maps/api...
null
alerting_timer/GoogleStaticMapParser.py
GoogleStaticMapParser.py
py
1,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 38, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 39, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 39, "usage_type": "name" }, { "api_name": "io.BytesIO", "line_number":...
316827277
import logging from six import iteritems def convert_metrics(metrics, tags): rows = [convert_metric(key, value, tags) for key, value in iteritems(metrics)] lines = [] for row in rows: if not row: continue first = [row['name']] if tags: first = first +...
null
fluxreporter/converter.py
converter.py
py
1,517
python
en
code
null
code-starcoder2
76
[ { "api_name": "six.iteritems", "line_number": 9, "usage_type": "call" }, { "api_name": "six.iteritems", "line_number": 20, "usage_type": "call" }, { "api_name": "six.iteritems", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.warning", "line_...
202268409
from factor_base import FactorBase import pandas as pd import numpy as np import dateutil.parser as dtparser from dateutil.relativedelta import relativedelta import datetime from influxdb_data import influxdbData from joblib import Parallel, delayed, parallel_backend from global_constant import N_JOBS class Surprise(...
null
quant_engine/Factor/Growth/Surprise.py
Surprise.py
py
5,124
python
en
code
null
code-starcoder2
76
[ { "api_name": "factor_base.FactorBase", "line_number": 12, "usage_type": "name" }, { "api_name": "influxdb_data.influxdbData", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.notnull", "line_number": 40, "usage_type": "call" }, { "api_name": "nump...
235995774
from __future__ import division, print_function import numpy as np import tensorflow as tf cross_entropy = tf.nn.softmax_cross_entropy_with_logits from time import time from data import load_mnist, to_gpu from svae.tf_nnet import init_mlp, tanh, identity # I wrote this example file to learn TensorFlow and develop a T...
null
examples/neural_net.py
neural_net.py
py
2,886
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.nn", "line_number": 4, "usage_type": "attribute" }, { "api_name": "tensorflow.reduce_mean", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.argmax", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow...
90727594
from django.contrib import admin from utils.utils import export_video, import_presentation from .models import Course, Slide class SlideInline(admin.TabularInline): model = Slide extra = 0 fields = ('image_url', 'notes', 'audio_url', 'status', 'assigned_to') readonly_fields = ('image_url', 'audio_url...
null
scholars/courses/admin.py
admin.py
py
1,171
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Slide", "line_number": 8, "usage_type": "name" }, { "api_name":...
192764071
""" The Flask app for the samjeeves.com portfolio website """ import json import os from datetime import datetime from flask import Flask, abort, render_template, send_from_directory from flask_bootstrap import Bootstrap from flask_assets import Environment, Bundle from github import Github app = Flask(__name__) ass...
null
samjeeves.py
samjeeves.py
py
4,768
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_assets.Environment", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_...
387263885
import requests from datetime import datetime from auth import * def zeropad(zeros, name): return "0" * (zeros - len(name)) + name def imageRetrieveTest(atHomeServer, hash, page, quality, chapterID): mdlink = "https://api.mangadex.org" link = atHomeServer.json()["baseUrl"] + quality + hash + '/' + page ...
null
sendToImgur.py
sendToImgur.py
py
7,392
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetim...
140256190
#!/usr/bin/env python import datetime import json import os import time from flask import abort, Flask, jsonify, request import requests __version__ = "0.1.3" app = Flask(__name__) try: SLACK_WEBHOOK = os.environ["SLACK_WEBHOOK"] app.logger.debug("Slack webhook URL found in env variable") except: SLACK...
null
pingdom2slack.py
pingdom2slack.py
py
13,193
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.abort", "line_number": 21, "usage_type": "call" }, { "api_name": "os.environ", "line_number...
127950030
import collections import cv2 import numpy as np from matplotlib import pyplot as plt from consts import xm_per_pix, ym_per_pix class Line: """ Model a lane-line. """ def __init__(self, buffer_len=10): # was the line detected in the last iteration? self.detected = False # po...
null
line_utils.py
line_utils.py
py
16,049
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.array", ...
495909170
def dump_list_to_string(lis,template): if not template: return lis assert isinstance(template, (list, tuple, set)) length = len(template) next_template = None if length == 1: cls=template[0] return str(lis) if length == 2: cls, splitchar = template else: ...
null
build/lib/wpkit/ofile/utils.py
utils.py
py
5,844
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 139, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 143, "usage_type": "call" } ]
235747472
import pickle from datetime import datetime class Fix: def __init__(self, name, value): self.value = value if self.value is None: value = 0 self.name = name def __str__(self): s = self.name if self.name == "Patch": s = s + ' (' + datetime.fromti...
null
src/models/Fix.py
Fix.py
py
573
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.fromtimestamp", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" } ]
565318183
import cv2 as cv import numpy as np from matplotlib import pyplot as plt img = cv.imread('bottle.jpg') rgb = cv.cvtColor(img, cv.COLOR_BGR2RGB) gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) edges = cv.Canny(gray, 100, 200) plt.subplot(121), plt.imshow(rgb) plt.title('Origin'), plt.xticks([]), plt.yticks([]) ...
null
Homework_submission/opencvex_DingZishuo/3.py
3.py
py
436
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_...
523875767
import numpy as np import pandas as pd from sklearn.metrics import recall_score def split_dataset_by_study(data, feature_names, excluded_study_labels=(20,)): """ :param data: Pandas df containing full newcomb data. :param excluded_study_labels: :return: """ PAYOFF_DICT = { 1.0: (3, 0....
null
utils.py
utils.py
py
4,112
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.nan", "line_number": 68, "usage_type": "attribute" }, { "api_name": "numpy.isnan", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 101, "usage_type": "call" }, { "api_name": "sklearn.metrics.recall_score...
149691971
import time import celery import pytest from celery_singleton import Singleton @celery.shared_task(base=Singleton) def takes_a_sec(*args, **kwargs): time.sleep(0.5) return args, kwargs @celery.shared_task(base=Singleton) def throws_an_error(*args, **kwargs): time.sleep(0.5) raise ValueError('The c...
null
tests.py
tests.py
py
2,810
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "celery.shared_task", "line_number": 9, "usage_type": "call" }, { "api_name": "celery_singleton.Singleton", "line_number": 9, "usage_type": "name" }, { "api_name": "time.sleep", ...
214079754
#coding: utf-8 import RPi.GPIO as GPIO import time #flask from flask import Flask #request from flask import request pin=16 pir_s=25 GPIO.setmode(GPIO.BCM) GPIO.setup(pin,GPIO.OUT) GPIO.setup(pir_s,GPIO.IN) def send(): try: while True: if GPIO.input(pir_s) == Tr...
null
workspace/서버담당/test_s4.py
test_s4.py
py
773
python
en
code
null
code-starcoder2
76
[ { "api_name": "RPi.GPIO.setmode", "line_number": 16, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 16, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 16, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "lin...
393471204
import openslide import glob, os, re import cv2 import numpy as np import pandas as pd import matplotlib as mpl mpl.use('TkAgg') from matplotlib import pyplot as plt import time from multiprocessing import Pool import shutil import pickle as pkl import math def circularity(cnt): return 4 * math.pi * cv2.contourArea(c...
null
processing_scripts/processData.py
processData.py
py
8,934
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.contourArea", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.arcLength", "line_...
582912841
# ----------------------------------------------------------------------- # Additional Documentation # Author: Thuan Tran # Date: April 15th.2017 # Randomness and Monte Carlo Method # Question 2 page 401 # ======================================================================= import ran...
null
Randomness and Monte Carlo Methods 1 /Question2.py
Question2.py
py
1,836
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.random", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.log2", "line_number"...
548724897
# -*- coding: utf-8 -*- """ Update Route53 Records based on Autoscaling event notifications sent via SNS. To configure your domain you need to specify: 1) Tags per Auto Scaling Group (ASG) : 'srvconfig' such as <Route53Zone:domain.com:prefix:SRV Client:SRV Server:SrvClientPort:SrvServerPort>. A Route53 entry will be...
null
ansible/roles/kraken.provider/kraken.provider.aws/files/lambda-sns-etcd-service-discovery.py
lambda-sns-etcd-service-discovery.py
py
8,055
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 17, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 34, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 70, "usage_type": "call" } ]
401125951
import cv2 from keras.preprocessing import image from scipy.ndimage.measurements import label import lanefind import numpy as np def apply_threshold(heatmap, threshold): # Zero out pixels below the threshold heatmap[heatmap <= threshold] = 0 # Return thresholded map return heatmap def draw_labeled_bbox...
null
convnet-vehicledetect.py
convnet-vehicledetect.py
py
7,729
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 21, ...
561385761
# -*- coding: utf-8 -*- import datetime # import pandas as pd from contextlib import contextmanager from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker import os import stockGF BASE_DIR = os.path.dirname(os.path.abspath(__file__)) db_path = os.pa...
null
dbwork.py
dbwork.py
py
12,799
python
en
code
null
code-starcoder2
76
[ { "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.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line...
15138060
""" Simple demo of a scatter plot. """ import numpy as np import matplotlib.pyplot as plt def limit(): x = [] y = [] with open("./limit.txt", 'r') as fr: #x.append(int(fr.readline())) flag = 0 for line in fr: if flag == 0: #print int(line.strip()) ...
null
knn/plot.py
plot.py
py
1,233
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.title", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 23, "usage_type": "call" }, { "api_name": "ma...
242358814
import logging from tornado.ioloop import IOLoop import tornado.web import tornado.iostream #import tornado.httpclient import socket import urlparse from base import BaseRequestHandler from ace import AceClient class AsyncStreamHttp: def __init__( self, url, on_data=None, on_close=None, on_headers=None, ioloop=Non...
null
handlers/proxy.py
proxy.py
py
8,040
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.info", "line_number": 14, "usage_type": "call" }, { "api_name": "tornado.ioloop.IOLoop.current", "line_number": 15, "usage_type": "call" }, { "api_name": "tornado.ioloop.IOLoop", "line_number": 15, "usage_type": "name" }, { "api_name": "urlp...
17096793
import torch.nn as nn import torch, h5py from torch.autograd import Variable from torch.utils.data import DataLoader import numpy as np import cv2 as cv import os from tqdm import tqdm from skimage.metrics import peak_signal_noise_ratio as psnr import matplotlib.pyplot as plt from DnCNN import DnCNN, DnCNN_Res from DnC...
null
train.py
train.py
py
8,330
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.utils", "line_number": 34, "usage_type": "attribute" }, { "api_name": "h5py.File", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.random", "l...
29179677
import logging import datetime from django.db import models from django.db import connection from django.shortcuts import reverse from simple_history.models import HistoricalRecords class Student(models.Model): name = models.CharField(max_length=50, db_index=True) FORM_STUDIES_CHOICES = ( ('БЮДЖЕТ', ...
null
hostel/models.py
models.py
py
6,858
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 11, "usage_type": "call" }, { "api_name"...
653028856
''' Created on Mar 7, 2017 @author: dicle ''' import nltk.stem.isri as isri def _stem1(word): stemmer = isri.ISRIStemmer() return stemmer.stem(word) def _stem_light(word): from tashaphyne.stemming import ArabicLightStemmer stemmer = ArabicLightStemmer() return stemmer.light_stem(word) ...
null
library/modules/language_tools/ar_stemmer.py
ar_stemmer.py
py
2,061
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.stem.isri.ISRIStemmer", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.stem.isri", "line_number": 13, "usage_type": "name" }, { "api_name": "tashaphyne.stemming.ArabicLightStemmer", "line_number": 21, "usage_type": "call" }, { "...
497874710
from django.core.management.base import BaseCommand, CommandError from recommendations.models import TreeCode from collections import defaultdict from django.db import transaction import pandas as pd import numpy as np from utils.ImportDataFile import readDataFile class Command(BaseCommand): help = 'Generates Tab...
null
recommendations/management/commands/generateTreeCodeTable.py
generateTreeCodeTable.py
py
6,368
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 10, "usage_type": "name" }, { "api_name": "recommendations.models.TreeCode.objects.all", "line_number": 40, "usage_type": "call" }, { "api_name": "recommendations.models.TreeCode.objects", "line_number": ...
335217364
import sublime import json from ..completions import CompletionList from ..inline_documentation import Documentation from .. import utils COMPLETION_FILES = ["cfml_tags","cfml_functions","cfml_member_functions"] DOC_STYLES = { "side_color": "#4C9BB0", "header_color": "#306B7B", "header_bg_color": "#E4EEF1", "text_...
null
src/basecompletions/basecompletions.py
basecompletions.py
py
5,433
python
en
code
null
code-starcoder2
76
[ { "api_name": "completions.CompletionList", "line_number": 20, "usage_type": "call" }, { "api_name": "completions.CompletionList", "line_number": 34, "usage_type": "call" }, { "api_name": "completions.CompletionList", "line_number": 41, "usage_type": "call" }, { "...
455537947
import numpy as np import cv2 from tkinter import * #Tkinter는 Tcl/Tk에 대한 파이썬 Wrapper로서 Tcl/Tk를 파이썬에 사용할 수 있도록 한 Lightweight GUI 모듈 import tkinter.filedialog as f #이걸로 코드실행 후 원하는 이미지 파일 불러올 수 있음 # 블록 파라볼라 함수 적용 root = Tk() root.filename = f.askopenfilename(filetypes=(("JPEG files",".jpg"),("ALL files", "*.*...
null
Visual-Processing/4-11 Block Parabola function.py
4-11 Block Parabola function.py
py
978
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 9, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 9, "usage_type": "name" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.IM...
415061765
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('chatApp', '0003_auto_20150801_0330'), ] operations = [ migrations.AddField( model_name='chatmessages', ...
null
realTime/chatApp/migrations/0004_chatmessages_masked_message.py
0004_chatmessages_masked_message.py
py
464
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
627058708
import gym from gym import error, spaces, utils from gym.utils import seeding from utils.flight import Flight import sys import numpy as np import matplotlib.pyplot as plt class BoeingSafe(gym.Env): metadata = {'render.modes': ['human']} def __init__(self): self.done = False self.flight = Fli...
null
Enviroment/gym-Boeing/gym_Boeing/envs/boeing_safe.py
boeing_safe.py
py
2,794
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.Env", "line_number": 10, "usage_type": "attribute" }, { "api_name": "utils.flight.Flight", "line_number": 15, "usage_type": "call" }, { "api_name": "gym.spaces.Box", "line_number": 19, "usage_type": "call" }, { "api_name": "gym.spaces", "lin...
536777432
#!/bin/env python3 import cv2 as cv import numpy as np import argparse import tuner.tuner as tuner def mag(gradient_x, gradient_y): gradient_mag = np.sqrt(np.square(gradient_x) + np.square(gradient_y)) return np.uint8(255 * (gradient_mag / np.max(gradient_mag))) def ths(img, ths_min, ths_max): ret = np...
null
examples/gradient_magnitude.py
gradient_magnitude.py
py
1,212
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sqrt", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.square", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 11...
521860155
# General libraries import pandas as pd import numpy as np # App libraries import streamlit as st import datetime # import sql DATABASE from database.sql_tables import database # Custom libraries from visuals.forecasts import plot_forecast ############################### STREAMLIT APP #############################...
null
forecasting/streamlit-app/app.py
app.py
py
1,980
python
en
code
null
code-starcoder2
76
[ { "api_name": "database.sql_tables.database", "line_number": 19, "usage_type": "name" }, { "api_name": "streamlit.sidebar.selectbox", "line_number": 21, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 21, "usage_type": "attribute" }, { "a...
188253764
# -*-coding=utf-8-*- # @Time : 2019/2/26 14:47 # @File : xltx_app.py import requests import pandas as pd url = 'http://10.18.6.101:8800/bid_list_sync?district=&endtime=&keyword={}&pageno=1&pagesize=10&queryNo=201902211555&starttime=&tender_type=0' words=['空调','平板电脑'] res =[] for item in words: r=requests.get(ur...
null
xltx_app.py
xltx_app.py
py
595
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" } ]
74244567
''' Introduction to neural networks This code will introduce: loss functions optimizers training the nn saving and loading a trained nn training the nn on a GPU This will help provide an understanding of: neurons weights biases l...
null
KIP/simplenn.py
simplenn.py
py
8,552
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 58, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 73, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 74, "usage_type": "call" }, { "api_name": "torch.tensor", "line_nu...
73358819
""" BTCUSD Price Reporter Example of a subclassed Reporter. """ import asyncio from typing import Any from typing import List from typing import Mapping from typing import Union from telliot.model.endpoints import RPCEndpoint from telliot.reporter.base import Reporter from telliot.submitter.base import Su...
null
src/telliot/reporter/interval.py
interval.py
py
3,797
python
en
code
null
code-starcoder2
76
[ { "api_name": "telliot.reporter.base.Reporter", "line_number": 17, "usage_type": "name" }, { "api_name": "telliot.model.endpoints.RPCEndpoint", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Mapping", "line_number": 26, "usage_type": "name" }, { ...
496971429
import pytest from indy import agent, IndyError from indy.error import ErrorCode @pytest.mark.asyncio async def test_agent_close_listener_works_for_outgoing(endpoint, wallet_with_identity): listener_handle = await agent.agent_listen(endpoint) assert type(listener_handle) is int wallet_handle, did = wall...
null
wrappers/python/tests/agent/test_agent_close_listener.py
test_agent_close_listener.py
py
1,145
python
en
code
null
code-starcoder2
76
[ { "api_name": "indy.agent.agent_listen", "line_number": 9, "usage_type": "call" }, { "api_name": "indy.agent", "line_number": 9, "usage_type": "name" }, { "api_name": "indy.agent.agent_add_identity", "line_number": 13, "usage_type": "call" }, { "api_name": "indy.a...
155387496
from transformers import MobileBertTokenizer, TFMobileBertForNextSentencePrediction import tensorflow as tf import random import numpy as np from Datasets.dataloader import load_dataset ################################# # MODEL HYPER-PARAMETERS ################################# EPOCHS = 3 BATCH_SIZE = 32 LEARNING_RATE...
null
Reranking/train.py
train.py
py
2,227
python
en
code
null
code-starcoder2
76
[ { "api_name": "transformers.TFMobileBertForNextSentencePrediction.from_pretrained", "line_number": 18, "usage_type": "call" }, { "api_name": "transformers.TFMobileBertForNextSentencePrediction", "line_number": 18, "usage_type": "name" }, { "api_name": "transformers.MobileBertToke...
151298746
#!/usr/bin/python """ script to privision languageivrmapping in vappscb EN | messages FR | messages_FR ES | messages_ES IT | messages_IT DE | messages_DE """ import pg languages = { 'EN': 'messages', 'FR': 'messages_FR', 'ES': 'messages_ES', 'IT': 'messages_IT', 'DE...
null
colado/task/g2_languages.py
g2_languages.py
py
857
python
en
code
null
code-starcoder2
76
[ { "api_name": "pg.connect", "line_number": 19, "usage_type": "call" } ]
306633491
import flask from flask import Flask, jsonify, request app = Flask(__name__) app.config["DEBUG"] = True class MyPython_Flask: # Create some test data for our catalog in the form of a list of dictionaries. books = [ {'id': 0, 'title': 'A Fire Upon the Deep', 'author': 'Vernor Vinge', 'firs...
null
Utilities/MyFlaskProject/api/api.py
api.py
py
2,298
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 42, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 46, "usage_type": "attribute" }, { "api_name": "flask.request", ...
175439885
# 連想配列 from collections import deque N = int(input()) ab = {} abl = [] path = [[] for _ in range(N)] for i in range(N-1): a,b = map(int,input().split()) path[a-1].append(b-1) path[b-1].append(a-1) abl.append((a-1,b-1)) ab[(a-1,b-1)] = 0 color = [0]*N color[0] = -1 q = deque([]) q.append(0) max = 0 ...
null
Python_codes/p02850/s335652570.py
s335652570.py
py
830
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
488811439
from __future__ import absolute_import import codecs import json from api.errorcode import ErrorCode from config import setting from datetime import datetime from log import logger from services.cache.progresscache import ProgressCache from services.collect.import_base import CollectImportBase from services.collect.m...
null
services/collect/csv_import.py
csv_import.py
py
40,375
python
en
code
null
code-starcoder2
76
[ { "api_name": "services.collect.import_base.CollectImportBase", "line_number": 17, "usage_type": "name" }, { "api_name": "services.cache.progresscache.ProgressCache", "line_number": 24, "usage_type": "call" }, { "api_name": "log.logger.info", "line_number": 41, "usage_typ...
607090098
import pathlib from io import StringIO from typing import Any, Dict, List, Union import dask.dataframe as dd import numpy as np import pandas as pd from ..pipe_base import Data, Params, PipeBase class MetaData: varTypes = { "ind": np.int8, # boolean like: -1 unknown, 0 FAlse, 1 True "numi": np....
null
dvb/datascience/data/csv.py
csv.py
py
6,149
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.int8", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.float64", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.str", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.str", "li...
484792000
import serializers from django.contrib import auth from django.contrib.auth.models import User from rest_framework import status from rest_framework.authtoken.models import Token from rest_framework.decorators import api_view, permission_classes from rest_framework.exceptions import NotFound from rest_framework.permiss...
null
home/views.py
views.py
py
3,745
python
en
code
null
code-starcoder2
76
[ { "api_name": "home.models.Post.objects.all", "line_number": 19, "usage_type": "call" }, { "api_name": "home.models.Post.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "home.models.Post", "line_number": 19, "usage_type": "name" }, { "api_n...
165147656
import matplotlib.pyplot as plt import numpy as np import pandas as pd import ast import evaluation from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import roc_auc_score from sklearn.metrics import mean_squared_error import math # load the dat...
null
ensemble_problem_level.py
ensemble_problem_level.py
py
8,895
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
564083223
from __future__ import division import numpy as np np.random.seed(123) import tensorflow as tf tf.set_random_seed(123) import funcs import krs import keras from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten , advanced_activations from kera...
null
script.py
script.py
py
8,783
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 4, "usage_type": "attribute" }, { "api_name": "tensorflow.set_random_seed", "line_number": 6, "usage_type": "call" }, { "api_name": "funcs.wha...
125152410
""" User-Artist-Song Poisson matrix factorization with Batch inference CREATED: 2014-03-25 02:06:52 by Dawen Liang <dliang@ee.columbia.edu> MODIFIED: 2015-03-25 13:06:12 by Jaan Altosaar <altosaar@princeton.edu> """ import sys import numpy as np from scipy import sparse, special, weave import pandas as pd from skl...
null
uaspmf.py
uaspmf.py
py
23,269
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 18, "usage_type": "name" }, { "api_name": "sklearn.base.TransformerMixin", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 52, "usage_type": "attribute" }, { "api_n...
436368850
from collections import defaultdict import re r1 = r'\[(\d+)-(\d+)-(\d+) (\d+):(\d+)\] ([a-zA-Z]+) (.*)' r2 = r'#(\d+) .*' rec = defaultdict(lambda: [0]*60) def extract(raw): mg = re.match(r1, raw) mm = int(mg.group(5)) ev = mg.group(6) rem = mg.group(7) return ev, mm, rem with open('input', 'r')...
null
2018/04/a.py
a.py
py
955
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "re.match", "line_number": 9, "usage_type": "call" }, { "api_name": "re.match", "line_number": 22, "usage_type": "call" } ]
526385494
# -*- coding: utf-8 -*- """ reV supply curve extent """ import logging import numpy as np import pandas as pd from reV.handlers.exclusions import ExclusionLayers from reV.utilities.exceptions import SupplyCurveError, SupplyCurveInputError from rex.utilities.utilities import get_chunk_ranges logger = logging.getLogge...
null
reV/supply_curve/extent.py
extent.py
py
17,494
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "reV.utilities.exceptions.SupplyCurveInputError", "line_number": 38, "usage_type": "call" }, { "api_name": "reV.handlers.exclusions.ExclusionLayers", "line_number": 44, "usage_type...
344635457
from flask import Flask from api import api from core import db_utils app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///tmp/test.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False api.api.init_app(app) db_utils.db.init_app(app) app.app_context().push() if __name__ == '__main__': app...
null
app.py
app.py
py
337
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "api.api.api.init_app", "line_number": 10, "usage_type": "call" }, { "api_name": "api.api.api", "line_number": 10, "usage_type": "attribute" }, { "api_name": "api.api", "line_...