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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
415226765 | import importlib
import functools
import re
import inspect
import flask as fl
from _view_decorator import View
class AtRest:
_types = {
"str": str,
"string": str,
"int": int,
"integer": int,
"float": float,
"boolean": bool,
"bool": bool,
"list": lis... | null | at_rest.py | at_rest.py | py | 6,849 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "inspect.getdoc",
"li... |
81119440 | from step11_a0_see_base import See_info
from step0_access_path import CORE_AMOUNT_NPY_TO_NPZ
from step0_access_path import Syn_write_to_read_dir
from kong_util.util import get_dir_certain_file_names, move_dir_certain_file
from kong_util.build_dataset_combine import Check_dir_exist_and_build
from kong_util.multiproce... | null | step11_a1_1_see_npy_to_npz.py | step11_a1_1_see_npy_to_npz.py | py | 13,427 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "step11_a0_see_base.See_info",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name... |
520393214 | #!/usr/bin/env python
from utils import handler
class HaConfig(object):
def __init__(self,hafile):
self.hafile = hafile
self.data = open(hafile,encoding="utf-8").readlines()
self.requried = ["server","ip","port"]
self.optional = ["cookie","check inter","weight","fall","r... | null | haproxy配置/haproxy.py | haproxy.py | py | 3,465 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.handler.lrspace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.handler",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "utils.handler.list2dic",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.hand... |
527797832 | #!/usr/bin/env python
# Copyright 2014 Open Connectome Project (http://openconnecto.me)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | null | ndmg/utils/loadGraphs.py | loadGraphs.py | py | 2,685 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.simplefilter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.pat... |
311556020 | #!/usr/bin/env python
import boto3
from time import time
from ed_common.loggerly import ElasticDevLogger
from ed_common.run_helper import EdReporter
class TriggerCodebuild(EdReporter):
def __init__(self,**kwargs):
self.classname = "TriggerCodebuild"
self.logger = ElasticDevLogger(self.classnam... | null | execgroups/_ed_configs/lambda_s3/_chrootfiles/var/tmp/lambda/src/main_codebuild.py | main_codebuild.py | py | 5,026 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ed_common.run_helper.EdReporter",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "ed_common.loggerly.ElasticDevLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ed_common.run_helper.EdReporter.__init__",
"line_number": 17,
"usage_t... |
91422420 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 8 13:35:19 2019
@author: hillel
"""
from keras.preprocessing.sequence import pad_sequences
from keras.layers.core import Dense
from keras.layers import LSTM
from keras.models import Model
from keras.layers.embeddings import Embedding
from sklearn.model_selec... | null | Multilabel_NN_Text Classifier_with_tensorboard.py | Multilabel_NN_Text Classifier_with_tensorboard.py | py | 2,650 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.text.Tokenizer",
"line_number": 38,
"usage_type": "call"
}... |
511393170 | from shapes.shape import Shape
from processes.click import Click
import cv2
DEFAULT_COLOR = (90, 200, 100)
DEFAULT_THINKNESS = 1
class Rect(Shape):
def __init__(self, rect, shape=None):
self.rect = rect
if shape is None:
super().__init__(DEFAULT_COLOR, DEFAULT_THINKNESS)
els... | null | shapes/rect.py | rect.py | py | 757 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "shapes.shape.Shape",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "processes.click.Click",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 26,
"usage_type": "call"
}
] |
256074615 | #coding=utf-8
import libs
import config as cfg
from redis import Redis
from securities import Securities
class Radar(list):
msg_board = {'general':[]}
redisdb = Redis(host=cfg.REDIS_HOST,port=cfg.REDIS_PORT,password=cfg.REDIS_PWD,decode_responses=True,charset='UTF-8', encoding='UTF-8')
def action_onsignal(sel... | null | tsaisendo/radar.py | radar.py | py | 2,012 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "redis.Redis",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.REDIS_HOST",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.REDIS_PORT",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.REDIS_P... |
349219792 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 16:48:12 2020
@author: prithvi
"""
import numpy as np
import matplotlib.pyplot as plt
import math
so = 10
ro = 10
sg = 10
rg = 1
x = 1
y = 1
locations = [[x,y]]
xg = 47
yg = 47
xo = 26
yo = 26
alpha = 2
beta = 7
dt = 0.01
for i in range(10000):... | null | potential_of_obstacle.py | potential_of_obstacle.py | py | 1,281 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "math.atan2",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "math.atan2",
"line_number": 31,
... |
370002520 | import time
import cv2
from kafka import KafkaProducer
from kafka.errors import KafkaError
import logging
topic = 'video-stream'
producer = KafkaProducer(bootstrap_servers=['localhost:9092'], retries=5)
def video_emitter(video):
video = cv2.VideoCapture(video)
print(' emitting.....')
while video.isOpened... | null | file-producer.py | file-producer.py | py | 1,041 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kafka.KafkaProducer",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imencode",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "kafka.errors.KafkaEr... |
427643975 | import json
source_files = ["train.json", "dev.json", "test.json"]
target_files = ["../train.tsv", "../dev.tsv", "../test.tsv"]
target_slots = ["category", "date", "location", "meal", "num_people", "price_range", "rating", "restaurant_name", "time"]
fp_ont = open("ontology.json", "r")
ontology = json.load(fp_ont)
fo... | null | MGL_SUMBT/data/M2M/sim-R/original/convert_to_glue_format.py | convert_to_glue_format.py | py | 2,153 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
}
] |
277402002 | import datetime
from dateutil.relativedelta import relativedelta
import csv
import re
class Parser(object):
def parse_lines_from_csv(self, lines, options):
"""
takes a file/list of strings in csv format and a dictionary of options
options['column_sequence'] is a list of strings represent... | null | lib/parser.py | parser.py | py | 5,045 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",... |
17901528 | from keras.datasets import imdb
from keras.preprocessing.text import text_to_word_sequence
from keras.preprocessing.text import one_hot
from keras.preprocessing.text import Tokenizer
import numpy as np
from keras import models
from keras import layers
from keras import optimizers
(train_data, train_labels), (test_data... | null | sample_scripts/keras_imdb.py | keras_imdb.py | py | 2,137 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.datasets.imdb.load_data",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.datasets.imdb",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "keras.datasets.imdb.get_word_index",
"line_number": 15,
"usage_type": "call"
},
{
... |
67455328 | """Validator classes for serializers and serializer fields."""
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
from rest_framework.exceptions import ValidationError
from rest_framework.utils.representation import smart_repr
class ValueTransitionValidat... | null | hammock/validators.py | validators.py | py | 4,746 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ImproperlyConfigured",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "rest_framework.exceptions.ValidationError",
"line_number":... |
19294500 | from django.urls import path, include
from . import views
app_name = 'mywiki'
# URL patterns. One of them is for testing purposes
urlpatterns = [
# This compares the URL from the URL bar with these patterns and loads a view according to the URL
path('', views.IndexView.as_view(), name = 'index'),
path('tes... | null | wiki/mywiki/urls.py | urls.py | py | 712 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
40668381 | #!/usr/bin/env python3
import sys
import os
import numpy as np
import argparse
from AaronTools.geometry import Geometry
from AaronTools.fileIO import FileWriter, FileReader
translate_parser = argparse.ArgumentParser(description="translate a fragment or molecule's coordinates", \
formatter_class=argparse.RawTextH... | null | bin/translate.py | translate.py | py | 5,956 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.RawTextHelpFormatter",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_nam... |
546251493 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import HttpResponse
from django.shortcuts import render,render_to_response
from .form import Info,AlbumForm
from Message.models import Message
# Create your views here.
def index(request):
# return HttpResponse('Messgae-------!')
... | null | Django/Hello/Message/views.py | views.py | py | 1,336 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "form.Info",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Message.models.Message.objects.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "Message.models.Message.objects",
"line_number": 26,
"usage_type": "attribute"
},
{
"... |
510023530 | from collections import Counter
def repeated_string(string: str, n: int) -> int:
"""
It should return an integer representing the number of occurrences of 'a' in the prefix
of length in the infinitely repeating string.
"""
number_of_a = Counter(string)['a']
remaining_letters = n % len(string)... | null | python/interview_pack/warm_up/repeated_string.py | repeated_string.py | py | 792 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
418619481 | import html
import jsonlines as jl
import mp_boilerplate as mpb
import mwparserfromhell
import mwxml
import pathlib
import typing as t
from argparse import ArgumentParser
from typeguard import typechecked
@typechecked
def wikimedia_to_json(mediawiki_in: pathlib.Path, jsonl_out: pathlib.Path, sub_process_count: int) ->... | null | code/wikimedia_to_json.py | wikimedia_to_json.py | py | 6,781 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "mp_boilerplate.EPTS",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "typeguard.typechecked",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pathlib.P... |
555949522 | import abc
from datetime import date
from decimal import Decimal
from typing import List, Any, Dict, Optional
from api import logger
from api.activities.activity_adapter import ActivityAdapter
from api.activities.activity_internal_models import (
AdapterActivity,
AdapterActivitySpecificSearch,
AdapterActiv... | null | api/activities/adapters/suppliers_api/suppliers_api_activity_adapter.py | suppliers_api_activity_adapter.py | py | 7,769 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "api.activities.activity_adapter.ActivityAdapter",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "api.activities.adapters.suppliers_api.suppliers_api_transport.SuppliersApiTransport"... |
239398732 | """
Object model representation of XML page.
"""
from lxml import etree
class Page(object):
"""
Object model representation of XML page.
"""
words_path = etree.XPath('//String/@CONTENT')
strings_path = etree.XPath('//String')
images_path = etree.XPath('//GraphicalElement')
page_path = et... | null | defoe/alto/page.py | page.py | py | 1,559 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lxml.etree.XPath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "lxml.etree.XPath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_n... |
490428627 | import numpy as np
import pandas as pd
from sklearn import model_selection
import matplotlib.pyplot as plt
from sklearn import tree
import graphviz
from sklearn.metrics import confusion_matrix
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import ... | null | Decision Tree Regressor/Cancer_DT_Regressor.py | Cancer_DT_Regressor.py | py | 3,787 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.ExcelFile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection",
"line_number": 31,
"usage_type": "name"
},
{
... |
494278064 | import xml.etree.cElementTree as ET
def xmlExport(fileName,Elist):
root = ET.Element("employees",company=Elist[0].company, brno=Elist[0].brno, cocode=Elist[0].cocode)
for k in Elist:
doc = ET.SubElement(root, "employee", name = k.name)
ET.SubElement(doc, "fullname").text = k.fullname
ET.SubElement(doc, "I... | null | xmlExpClass.py | xmlExpClass.py | py | 483 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xml.etree.cElementTree.Element",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "xml.etree.cElementTree.SubElement",
"line_number": 7,
"usage_type": "call"
},
{
... |
610090096 | """Testing module for like views."""
import json
from django.test import TestCase
from django.urls import reverse
from checkpoint.models import Checkpoint
from comment.models import Comment
from like.models import Like
from photo.models import Photo
from registration.models import CustomUser
from trip.models import ... | null | myTrip/tests/unittests/like/test_views.py | test_views.py | py | 4,775 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "registration.models.CustomUser.objects.create",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "registration.models.CustomUser.objects",
"line_number": 33,
"usage_typ... |
613766428 | import torch
import torch.onnx
from reactnet import reactnet
# create ReActNet model
model = reactnet()
#for key, v in enumerate(model.state_dict()):
# print(key, v)
print("Model's state_dict:")
for param_tensor in model.state_dict():
if param_tensor.find('binary') != -1 :
print(param_tensor, "\t", mo... | null | mobilenet/2_step2/onnx_export.trained.py | onnx_export.trained.py | py | 1,419 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "reactnet.reactnet",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
... |
199933516 | import xarray as xr
import matplotlib.pyplot as plt
import matplotlib as mpl
import os
from mpl_toolkits.basemap import Basemap
from matplotlib.colors import BoundaryNorm
from matplotlib.colors import LinearSegmentedColormap
import numpy as np
runame = '1day_valdtest'
#'SAmerica_CORDEX_Noah-MP'
#'CONUS-RRTM_1hourly'
... | null | comparison_plots.py | comparison_plots.py | py | 10,269 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xarray.open_dataset",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "xarray.open_dataset",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "ma... |
74355697 | import csv
import utilsConf
import datetime
HEADER = ["id", "product", "component", "assigned_to", "status", "resolution", "reporter", "last_change_time", "version", "target_milestone", "platform", "op_sys", "priority", "severity", "summary", "keywords", "creation_time", "blocks", "depends_on", "Duplicate Of", "cc"]
B... | null | learner/wekaMethods/issuesExtract/csv_labels.py | csv_labels.py | py | 1,107 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "csv.writer... |
608509121 | import cv2
from pytube import YouTube
import sys
import os
import process_images
import numpy as np
def store_video(vid):
# if not already downloaded, store video into a specific directory
file = YouTube(vid)
# filter for a stream with 1080p and a mp4 format
stream = file.streams.filter(res='1080p', m... | null | process_video.py | process_video.py | py | 2,700 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytube.YouTube",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_n... |
398678941 | from PyQt4 import uic
import pyodbc
import os.path
( Ui_Add_Monster_Speed_Window, QDialog ) = uic.loadUiType( 'Add_Monster_Speed_Window.ui' )
class Add_Monster_Speed_Window ( QDialog ):
"""Add_Monster_Speed_Window inherits QDialog"""
def __init__ ( self, parent = None ):
QDialog.__init__( s... | null | Monkey Studio Files/Add_Monster_Speed_Window.py | Add_Monster_Speed_Window.py | py | 1,324 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt4.uic.loadUiType",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PyQt4.uic",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.path.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.path",
... |
312795650 | __author__ = 'aliubushyn'
from flask import request
from flask import url_for
from flask import session
from flask import flash
from flask import redirect
class TwitterStrategy:
def __init__(self, oauth, db):
self.twitter = oauth.remote_app('twitter',
base_url='http... | null | TwitterStrategy.py | TwitterStrategy.py | py | 2,134 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.request.args.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "flask.ur... |
486488532 | import torch
import torch.nn as nn
import torch.nn.functional as F
from params import params
class WaveUNetPP(nn.Module):
def __init__(self):
super(WaveUNetPP, self).__init__()
self.L = params["L"]
self.K = params["K"]
self.Fc = params["Fc"]
self.fd = params["fd... | null | waveUnet++/wave_u_net_pp.py | wave_u_net_pp.py | py | 3,516 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "params.params",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "params.params",
"line_n... |
613656858 | from config import firestore
class DatabaseManager:
def __init__(self, collection):
self.collection = firestore.client().collection(collection)
self.querries = self.collection
def write(self, docID, obj):
response = {
"status": False,
"error": None
... | null | Persistence/DatabaseManager.py | DatabaseManager.py | py | 4,541 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "config.firestore.client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.firestore",
"line_number": 7,
"usage_type": "name"
}
] |
620879754 | import numpy as np
import torch
import torch.nn as nn
class NormalConvolutionLayerRelu(nn.Module):
def __init__(self, filters, kernel_size, input_size, padding=0, stride=1):
super().__init__()
# parameters
self.kernel_size = kernel_size
self.filters = filters
self.padding = padding
self.stri... | null | Pytorch/NormalRelu/source/layer.py | layer.py | py | 1,720 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.relu",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Parameter",
... |
343873576 | # -*- coding: utf-8 -*-
"""
Created on Thu May 14 13:12:30 2020
@author: Jacob
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal as ss
from scipy import io
import librosa
import librosa.display
import scipy.fftpack as fftpack
def window(window_name, M):
if window_name == 'boxcar':
... | null | P4/frequency_transposition.py | frequency_transposition.py | py | 8,085 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.signal.windows.boxcar",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.signal.windows",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "scipy.signal",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sc... |
416335712 | import pytest
import json
import importlib
import os
import re
import boto3
from moto import mock_s3
from mock import patch
import six
if six.PY2: FileNotFoundError = IOError
import pandas as pd
from great_expectations.data_context.store import (
StoreBackend,
InMemoryStoreBackend,
FixedLengthTupleFiles... | null | tests/store/test_store_backends.py | test_store_backends.py | py | 10,613 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "six.PY2",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "great_expectations.data_context.store.StoreBackend",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 32,
"usage_type": "call"
},
{
"api... |
50109239 | #!/usr/bin/env python
# NOTE: needs Python 2, for pyqt5
# https://bugs.kde.org/show_bug.cgi?id=362967
import sys
import PyQt5
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import (QWidget, QLineEdit, QLabel, QPushButton,
QHBoxLayout, QVBoxLayout, QMenu, QWidgetAction, QApplication)
def handler(msg_type, ms... | null | python/main.py | main.py | py | 2,238 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtCore.qInstallMessageHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QWidgetAction",
"line_number": 16,
"usage_type": "name"
},
{
... |
249954847 | # -*- coding: utf-8 -*-
from datetime import datetime
import oaipmh
import oaipmh.metadata
import oaipmh.server
import oaipmh.error
from metadata import OAILEXML
def get_writer(prefix, config={}):
writer = OAILEXML
return writer(prefix, config={})
class OAIServer(object):
"""An OAI-2.0 compliant oai ... | null | branches/4.0_buildout/openlegis/sagl/lexml/OAI.py | OAI.py | py | 5,050 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "metadata.OAILEXML",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "oaipmh.common.Identify",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "oaipmh.common",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "datetime.... |
311392734 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import json
from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from... | null | AppSpider/moments.py | moments.py | py | 6,811 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "appium.webdriver.Remote",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "appium.webdriver",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 31,
"usage_type": "call"
},
{
... |
16211154 | import requests
from bs4 import BeautifulSoup as BS
url = "https://geo.craigslist.org/iso/us"
headers = {"user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4"}
response = requests.get(url, headers=headers)
soup = BS(r... | null | phoneFinder.py | phoneFinder.py | py | 559 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
}
] |
144552270 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index), # to homepage
url(r'^optionsDisplay$', views.distance), # to page where they will choose distance
url(r'^roulett$', views.roulett), # will process their request and redirect to resultsDisplay
url(r'^resultsDi... | null | apps/roulette/urls.py | urls.py | py | 872 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
218818146 | import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import scipy
import torch
import os
import numpy as np
import seaborn as sns
prefix_dir = os.path.join(os.getcwd(), 'results')
#env_list = ['Hopper', 'HalfCheetah', 'Walker2d', 'Ant', 'Swimmer']
env_list = ['Swimmer', 'HalfCheetah', 'Ant', 'Walker2d... | null | plot_all.py | plot_all.py | py | 4,002 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "seaborn.color_palette",
"line_nu... |
384723895 | #!/usr/bin/env python3
# A simple web server that recieves a GitHub hook
# config
hook_ips = ["204.232.175.64/27", "192.30.252.0/22", "127.0.0.1"] # GitHub and localhost by default
hook_repository = "SirCmpwn/wormy"
hook_branch = "master"
restart_command = "/usr/local/bin/restart-wormy"
# end config
from flask import... | null | server/server.py | server.py | py | 1,354 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request.remote_addr",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "json.loads",... |
582507198 | from django.shortcuts import render, get_object_or_404, redirect
from django.core.paginator import (Paginator,
PageNotAnInteger,
EmptyPage)
from django.core.mail import send_mail
from django.db.models import Count
from .models import Category, Post,... | null | blog/views.py | views.py | py | 3,814 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Post.published.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Post.published",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "mode... |
35752186 | from django.shortcuts import render
from Models.models import Order, Goods
from django.urls import reverse
from django.http import HttpResponse,HttpResponseRedirect
# Create your views here.
def modify(request):
UID=request.session.get('uid','-1')
if UID == '-1':
return HttpResponseRedirect(reverse("lo... | null | project/djangoProject/modifyOrder/views.py | views.py | py | 1,820 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 17,
"usage_type": "call"
},
{
"api... |
479219133 | #!/usr/bin/env python
# coding: utf-8
# ## Script to obtain afternoon rainfall occurence and its soil moisture conditions
# 1. divide the CONUS domain into 120km*120km blocks (30*30 pixels)
# 2. loop through each box and each day
# 3. accumulate afternoon rainfall and smooth into 24km*24km boxes
# 4. find the box with... | null | ObtainSH_Locations_for_NightRain_24km120km_iterate.py | ObtainSH_Locations_for_NightRain_24km120km_iterate.py | py | 25,115 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_... |
563908123 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import time
from ssl import AF_INET, SOCK_STREAM, socket
parser = argparse.ArgumentParser(description='simple socket test')
parser.add_argument(
'-H', '--host', metavar='127.0.0.1', dest='host', default='0.0.0.0')
parser.add_argument(
'-P... | null | study/programming_python_4th/internet/fork-server.py | fork-server.py | py | 1,524 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ssl.socket",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ssl.AF_INET",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "ssl.SOCK_STREAM",
... |
508805805 | import ezdxf
from ezdxf.lldxf import const
# AutoCAD 2010 can not resolve XREFS in DXF R12 Format :-(,
ref_dwg = ezdxf.new('AC1015')
ref_dwg.modelspace().add_circle(center=(5, 5), radius=2.5)
ref_dwg.saveas("xref_drawing.dxf")
# XREF definition
host_dwg = ezdxf.new('AC1015')
xref_def = host_dwg.blocks.new(name='my_x... | null | examples/using_xref.py | using_xref.py | py | 508 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ezdxf.new",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ezdxf.new",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ezdxf.lldxf.const.BLK_XREF",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "ezdxf.lldxf.const"... |
88787472 | import json
file = open("dane_pierwsze.json")
wspolczynniki = json.load(file)
file_for_results = open('koncowe_wyniki1_Pawel.txt', 'w+')
def fun(type_of_stone, mass=float(input('Podaj mase'))):
a, b = wspolczynniki[type_of_stone]
print(b)
return a * mass + b
print(fun('RD'))
| null | praktyki_pawel/archiwum/end_file_1.py | end_file_1.py | py | 293 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
}
] |
482994663 | from django.urls import path
from .views import org_create, org_login, org_architecture, team_create, org_create_project, org_project_accept, org_submission_list, parent_project_list, org_projects_list, org_team_create, user_logout
urlpatterns = [
path('create/', org_create, name="org_create"),
path('login/',... | null | Organization/urls.py | urls.py | py | 1,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.org_create",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.org_login",... |
345339730 | import numpy as np
import moderngl
class ScreenLineRender(object):
def __init__(self, ctx, window):
self.ctx = ctx
self.program = self.ctx.program(
vertex_shader='''
#version 430
uniform vec4 Pts;
in vec2 in_vert... | null | animation/npk/animation_framework/viewer/screenlinerender.py | screenlinerender.py | py | 1,762 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "moderngl.LINES",
"line_number... |
633812308 | import matplotlib as mpl
mpl.use('agg')
import os
import sys
import shutil
import argparse
import numpy as np
import pylab as plt
import healpy as hp
from ccgpack import ch_mkdir,download
#from healpy import cartview
cmap = plt.cm.jet
cmap.set_under('w')
cmap.set_bad('gray',1.)
parser = argparse.ArgumentParser(descr... | null | data/data_initiator.py | data_initiator.py | py | 5,521 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pylab.cm",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"... |
111138054 | import numpy as np
import sys
import pickle
import time
import datetime
import pm
import tools as tl
import sys
import init
import matplotlib.pyplot as plt
import os
# # Q = tl.load_state('/home/navdeep/TicTac/Q')
# # Q = pickle(open('Q2', 'wb'))
# Q, filename = tl.initialize_Q()
# S = list(Q.keys())
# # valid start... | null | main.py | main.py | py | 3,051 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.system",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "init.init",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pm.initial_Q",
"line_number": 2... |
145669649 | import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def bar_plot():
means_men = (20, 35, 30, 35, 27)
means_women = (25, 32, 34, 20, 25)
index = np.arange(len(means_men))
bar_width = 0.35
plt.bar(index, means_men, width=bar_wid... | null | learn_matplotlib/bar_plot.py | bar_plot.py | py | 929 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.arange",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplo... |
374803688 | import os, shutil
import json
from tqdm import tqdm
_dir_ = '/data/vision/billf/scratch/ruidongwu/data/data_v0'
dst_dir = '/data/vision/billf/scratch/ruidongwu/data/partnet/default'
if not os.path.exists(dst_dir):
os.makedirs(dst_dir)
to_move = os.listdir(_dir_)
for num in tqdm(to_move):
to_move_dir = os.pat... | null | scripts/move_partnet_ori.py | move_partnet_ori.py | py | 733 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": ... |
596543684 | import uuid
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Host(models.Model):
hostname = models.CharField(max_length=32, unique=True, verbose_name=_("Hostname"))
description = models.CharField(max_length=32, null=True, blank=True, verbose_name=_("Description"))
... | null | src/hostnamed/models.py | models.py | py | 948 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
634533584 | import xml.etree.ElementTree as ET
import pickle
import os
from os import getcwd
import numpy as np
from PIL import Image
import imgaug as ia
from imgaug import augmenters as iaa
ia.seed(1)
def mkdir(path):
# 去除首位空格
path = path.strip()
# 去除尾部 \ 符号
path = path.rstrip("\\")
# 判断路径是否存在
# 存在 ... | null | XML-Augment-master/XMLaug.py | XMLaug.py | py | 1,964 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "imgaug.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_numbe... |
479454721 | from django.urls import path
from . import views
from user.models import Application
urlpatterns = [
path('consultation', views.consultation, name='consultation'),
path('applicationForm', views.application, name='applicationForm'),
path('login', views.user_login, name='login'),
path('loginForApp', vie... | null | practice5/user/urls.py | urls.py | py | 1,018 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
436186226 | """Annif backend mixins that can be used to implement features"""
import abc
import os.path
import joblib
from sklearn.feature_extraction.text import TfidfVectorizer
import annif.util
from annif.exception import NotInitializedException
from annif.suggestion import ListSuggestionResult
class ChunkingBackend(metaclas... | null | annif/backend/mixins.py | mixins.py | py | 2,536 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "abc.ABCMeta",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "annif.suggestion.ListSuggestionResult",
"line_number": 39,
"usage_type": "call"
},
{
"ap... |
585646975 | from django.core.files.storage import default_storage
import os
from django.core.files.base import ContentFile
import traceback
from disturbance.components.main.models import TemporaryDocument
from django.conf import settings
from disturbance.components.proposals.models import ProposalApiary, Proposal, PublicLiabilit... | null | disturbance/components/main/process_document.py | process_document.py | py | 9,666 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "disturbance.components.proposals.models.DeedPollDocument.DOC_TYPE_NAME",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "disturbance.components.proposals.models.DeedPollDocument",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "disturbance.... |
301243513 | # coding=utf-8
"""
synopsis: program entry
author: haoranzeus@gmail.com (zhanghaoran)
"""
import codecs
import getopt
import logging.config
import os
import sys
import yaml
def usage():
print('some usage information')
def main(argv):
try:
opts, args = getopt.getopt(
argv, "c:", ["con... | null | main.py | main.py | py | 2,052 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "getopt.getopt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "getopt.GetoptError",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"li... |
65192274 | """
Implementation of the periodic kernels.
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# import numpy as np
from ..core.domains import Positive, Real
from ..utils.misc import rstate
from ._core import RealKernel
from ._distances import rescale, d... | null | reggie/kernels/periodic_linear.py | periodic_linear.py | py | 3,778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "_distances.dist",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "autograd.numpy.pi",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "autograd.numpy",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "autograd.numpy.... |
597719296 | import os
import shutil
from PIL import Image, ImageOps
from global_pathnames import cropping_images_folder as image_folder_pathname
import numpy
if __name__ == "__main__":
for item in os.scandir(image_folder_pathname):
if item.is_file():
try:
#absolute path to image file
... | null | cropping-images/cropping.py | cropping.py | py | 1,551 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.scandir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "global_pathnames.cropping_images_folder",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.... |
365082738 | #
# CasADi Solver class
#
import casadi
import pybamm
import numpy as np
from scipy.interpolate import interp1d
from scipy.optimize import brentq
class CasadiSolver(pybamm.BaseSolver):
"""Solve a discretised model, using CasADi.
**Extends**: :class:`pybamm.BaseSolver`
Parameters
----------
mode ... | null | pybamm/solvers/casadi_solver.py | casadi_solver.py | py | 21,794 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pybamm.BaseSolver",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pybamm.citations.register",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "pybamm.citations",
"line_number": 104,
"usage_type": "attribute"
},
{
"api_name... |
426630699 | '''
Views
This module contains the method serve_rpc_request which is intended to
be called from the urls.py module of a
`django <http://www.djangoproject.com/>`_ project.
It should be called like this from urls.py:
rpc_url(r'^RPC2$', name="my_url_name"),
'''
import logging
from xml.dom.minidom import parseStr... | null | vt_manager/src/python/vt_manager/common/rpc4django/views.py | views.py | py | 10,573 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "django.conf.settings",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "django.conf.settings",
"line_number": 31,
"usage_type": "argument"
},
{
"api_na... |
497991582 | from Constants import directories
from Util.files import saveJSONObject
from lib.learn import createFeatureMatrix
spanishWords = directories.SPANISH_WORD_SET
germanWords = directories.GERMAN_WORD_SET,
frenchWords = directories.FRENCH_WORD_SET
'''
featuresTrain, labelsTrain = createFeatureMatrix(spanishWords, germanWor... | null | main/extractFeatures.py | extractFeatures.py | py | 1,232 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Constants.directories.SPANISH_WORD_SET",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "Constants.directories",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "Constants.directories.GERMAN_WORD_SET",
"line_number": 6,
"usage_type": "... |
444183210 | '''
Template tags for paypal offsite payments
'''
from string import split
from django.conf import settings
from paypal.standard.forms import PayPalPaymentsForm
from billing.utils.required import require
def paypal_buy(context):
'''render paypal form to buy item'''
require(context, *split('notify_url return... | null | billing/templatetags/paypal_forms.py | paypal_forms.py | py | 853 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "billing.utils.required.require",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "string.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.PAYPAL_RECEIVER_EMAIL",
"line_number": 16,
"usage_type": "attribute"
}... |
337961227 | import random, math
import os, cv2, shutil
import numpy as np
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import xml.etree.ElementTree as ET
from collections import OrderedDict
import matplotlib.pyplot as plt
from src.draw_graph import *
import arch.config as config
# Set printopt... | null | src/utils.py | utils.py | py | 41,932 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.set_printoptions",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": ... |
133298072 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright 2020 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
""" Tests for key management (generating public/private key)
"""
from os import path
from spsdk.crypto.keys_management import generate_rsa_private_key, generate_rsa_public_key, \
save_private_key, save_pu... | null | tests/crypto/test_key_gen.py | test_key_gen.py | py | 1,491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "spsdk.crypto.keys_management.generate_rsa_private_key",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "spsdk.crypto.keys_management.generate_rsa_public_key",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "spsdk.crypto.keys_management.save_priv... |
294388387 | from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
import importlib
import os
import pytest
from pureapi import common
def test_valid_version():
versions = common.versions
assert len(versions) > 0
assert all(common.valid_version(version) for version in versions)
assert not common... | null | tests/test_common.py | test_common.py | py | 2,426 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "dotenv.find_dotenv",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pureapi.common.versions",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pure... |
318595739 | '''
Resize image
* `resize_crop` crop the image with a centered rectangle of the specified size.
* `resize_cover` resize the image to fill the specified area, crop as needed (same behavior as `background-size: cover`).
* `resize_contain` resize the image so that it can fit in the specified area, keeping the ratio and w... | null | posts/it - python get started/python - resize image/resizeimage.py | resizeimage.py | py | 2,839 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.LANCZOS",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "PIL.Image.LANCZOS",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
... |
239504637 | # #
# @file: intfc_nltk_features.py
# @author: shicq@cs.brandeis.edu
# @brief: collect features and dump
# #
import sys,os,time,nltk, cPickle as pickle
from intfc_common_io import log, home, save_features, load_featu... | null | src/main/resources/pythons/intfc_nltk_features.py | intfc_nltk_features.py | py | 2,009 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "intfc_common_io.log",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nltk.FreqDist",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "intfc_common_io.log",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "intfc_common_io... |
619041229 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /Users/sage/fatedoc/FATE/federatedml/param/homo_nn_param.py
# Compiled at: 2020-04-30 07:16:32
# Size of source mod 2**32: 6524 bytes
import copy, typing
from typ... | null | pycfiles/ETAF-1.4.0rc0-py3-none-any/homo_nn_param.cpython-37.py | homo_nn_param.cpython-37.py | py | 5,907 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "federatedml.param.base_param.BaseParam",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "federatedml.param.predict_param.PredictParam",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "federatedml.param.cross_validation_param.CrossValidationParam... |
58261682 | '''This test suite contains 7 passing tests. '''
import pytest
from seleniumbase import BaseCase
from basic_methods import BasicMethods as bm
import config
import constants as const
import time
class TestTasksList(BaseCase):
def get_task_name(self, row=1, column=2):
'''Returns value of elemen... | null | p-jonczyk/tasks_list.py | tasks_list.py | py | 10,449 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "seleniumbase.BaseCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "config.url",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "basic_methods.BasicM... |
235077066 | import numpy as np
import numpy.linalg as la
import pickle
import torch
import torch.utils.data as td
import torch.nn as nn
import torch.nn.functional as nnF
import torch.optim as optim
import sys
import matplotlib.pyplot as plt
sys.path.append('../lib')
sys.path.append('.')
import helpers
conv = np.array(helpers.pic... | null | jacobi-cnn/show_plots.py | show_plots.py | py | 2,726 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
453515653 | #! /usr/bin/env python
#./filter_majors.py fos_maj_data.xlsx fos B A D
import openpyxl as px
import sys
import csv
import subprocess
def make_major_dict(filename,sheetname,first,second,third):
first = str(first).upper()
second = str(second).upper()
wb = px.load_workbook(filename)
inf = wb.active
p = wb.get_sheet_b... | null | net_sci_project1/filter_majors.py | filter_majors.py | py | 1,508 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sys.argv",
... |
621028722 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import inspect
import logging
import six
from flask import Flask, current_app, g, render_template
import utils4py
import utils4py.scan
import utils4py.flask_ext.service
from utils4py.flask_ext.service import ResultBuilder
__FIELD_FLAG_SERVICE_IMPL = "_flag_svr_impl"
__F... | null | utils4py/flask_ext/routes/__init__.py | __init__.py | py | 5,154 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "six.integer_types",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "utils4py.TextUtils.json_dumps",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "utils4py.TextUtils",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_... |
461759761 | import os
import io
import boto3
import json
import csv
# grab environment variables
ENDPOINT_NAME = 'linear-learner-2020-11-24-18-50-45-646'
runtime= boto3.client('runtime.sagemaker')
#PRESSURE TEMPERATURE HUMIDITY
def predict_anomaly(event, context):
#load to json
data = json.loads(event)
observation =... | null | project-realtime-temp-anomaly-detection/lambdas/raz_lambda_kinesis_fh_transform/lambda_test.py | lambda_test.py | py | 1,360 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "boto3.client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 34,... |
451519477 | from selenium import webdriver
from selenium.webdriver import ActionChains
import time
driver= webdriver.Chrome(executable_path="C:\\Drivers\\chromedriver.exe")
driver.maximize_window()
driver.implicitly_wait(10)
driver.get("https://demoqa.com/menu/")
time.sleep(5)
Music=driver.find_element_by_xpath("//*[@id='ui... | null | SeleniumwithPython/MouseHover.py | MouseHover.py | py | 609 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdri... |
220983370 | import re
import subprocess
import sys
from io import StringIO
import requests
from flask import Flask, request, render_template, jsonify, json
from mtgsdk import Card
from sqlalchemy import or_
from sqlalchemy.ext.declarative import DeclarativeMeta
import tests
from models import Player, Team, Venue, Game, PlayerGam... | null | application.py | application.py | py | 17,731 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.render_template",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.app.route",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.app",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "flask.render_templa... |
69370018 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask,render_template,request,json,redirect,url_for,session
import os
from engine import speech2text
from audioUtils import standard_file
import asyncio
import time
import sqlite3
from flask_session import Session
from pydub import AudioSegment
import mat... | null | server.py | server.py | py | 9,702 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_session.Session",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.session... |
334632212 | """
file mover from s3 buckets
"""
import boto3
from botocore.exceptions import ClientError
import auth
def decrypt_aws_keys(kwargs):
""" decrypt the aws authorisation keys"""
decoder = auth.Auth()
access_path = kwargs['access_path']
access_file = kwargs['access_file']
secrets_path = kwargs['se... | null | src/helpers/async_mover.py | async_mover.py | py | 2,248 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "auth.Auth",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "boto3.client",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "boto3.resource... |
54274666 | """
Gilded Rose Inventory Application
"""
import sys
import save_and_resume
import base_functions
import os
import argparse
def parse_input_arguments():
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument('-useinput', action='store_true', default=False,
h... | null | app/main_app.py | main_app.py | py | 3,011 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
172515720 | from core.tests.base_test_case import BaseTestCase
from model_mommy import mommy
from fields.services import CheckPolygon
class TestCheckPolygon(BaseTestCase):
def setUp(self):
super().setUp()
self.cad_info = mommy.make('cadastral.CadastralInfo')
def test_successful_check(self):
pol... | null | agronom/fields/tests/test_services.py | test_services.py | py | 1,349 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "core.tests.base_test_case.BaseTestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "model_mommy.mommy.make",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "model_mommy.mommy",
"line_number": 11,
"usage_type": "name"
},
{
"ap... |
416274870 | import os
import numpy as np
#from sklearn.metrics import roc_curve, auc
#import matplotlib.pyplot as plt
#import sklearn
import cv2
import sys
import joblib
#import glob
#from prettytable import PrettyTable
import pandas as pd
def read_template_media_list(path):
ijb_meta = np.loadtxt(path, dtype=str)
template... | null | evaluation/IJBC/score_calc.py | score_calc.py | py | 5,026 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.loadtxt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.int",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"li... |
254590526 | from io import BytesIO, StringIO
import requests
import lambda_requests
from tests.base import (
BINARY_PAYLOAD,
HTTP_URL_PREFIX,
LAMBDA_URL_PREFIX,
UNICODE_PAYLOAD,
PatcherBase,
)
def _seek_reset_request(accessor, url_path, *args, **kwargs):
if "files" in kwargs:
for file_item in kw... | null | tests/test_lambda_integration.py | test_lambda_integration.py | py | 3,822 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tests.base.PatcherBase",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "requests.Session",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "lambda_requests.Session",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tests... |
591181812 | from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import uuid
import sys
sys.path.insert(1, 'C:/Users/mohni/Desktop/github_chatbot/iiitd_policy_chatbot/notebooks')
import qa_helper
import qa_model
from dotenv import load_dotenv
import os
load_dotenv()
# NEO4J_USERNAME = os.getenv('NEO4J_USERNAM... | null | server file/server_2.py | server_2.py | py | 2,565 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "qa_model.init",
"l... |
353937728 | from django.urls import path
from main_app import views
app_name = 'main'
urlpatterns = [
path('category/',views.category_page,name='category'),
path('details/',views.book_details,name='details'),
path('booklist/',views.category_book_list,name='booklist'),
] | null | main_app/urls.py | urls.py | py | 274 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "main_app.views.category_page",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "main_app.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django... |
165258131 | """ RHEA/RMHC Test suite on simple environments """
# Copyright (c) 2020, - All Rights Reserved
# This file is part of the Evolutionary Planning on a Learned World Model thesis.
# Unauthorized copying of this file, via any medium is strictly prohibited without the consensus of the authors.
# Written by Thor V.A.N. ... | null | tests_custom/other/test_real_game_planning.py | test_real_game_planning.py | py | 3,402 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "planning.real.random_mutation_hill_climbing.RMHC",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "... |
294727237 | #!/usr/bin/env python
import os
import sys
import time
import shlex
import subprocess
sys.path.append("/usr/lib/hive/lib/py")
import logging, logging.handlers
from optparse import OptionParser
"""
Integers
TINYINT - 1 byte integer
SMALLINT - 2 byte integer
INT - 4 byte integer
BIGINT - 8 byte intege... | null | hive_import.py | hive_import.py | py | 6,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_nu... |
460413997 | from django.db import models
from django.contrib.auth.models import User as AuthUser
class User(models.Model):
user = models.ForeignKey(AuthUser, primary_key=True)
trello_token = models.TextField(null=True)
class BoardFilter(models.Model):
user = models.ForeignKey(AuthUser)
board_id = models.TextFie... | null | komma/models.py | models.py | py | 1,078 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": ... |
209046650 | from setuptools import setup, find_packages
import os
version = '0.5.0'
tests_require=['zope.testing']
setup(name='Products.PloneboardNotify',
version=version,
description="A configurable Plone product for sending e-mails when new message is added on Ploneboard forum",
long_description=open("README... | null | setup.py | setup.py | py | 1,584 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_nu... |
52942246 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
## author : cypro666
## date : 2015.06.06
"""
This module implements a full-stack asynchronous http client based on tornado framework
"""
import re, time
import threading
try:
import select
except ImportError:
pass
from tornado import gen, queues, ioloop
try:
... | null | magic3/asyncs/httpclient.py | httpclient.py | py | 6,554 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "select.select",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number... |
430266301 | import glados
import collections
from datetime import datetime, timedelta
BUFFER_LEN = 5
TIME_THRESHOLD = 2 # If the average time between messages sinks below this (in seconds), the user is kicked
cdfs_server_id = '318450472157577218'
mute_role_id = '322430117760729088'
class AntiSpam(glados.Module):
def __ini... | null | modules/general/antispam.py | antispam.py | py | 1,555 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "glados.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
533672974 | #!/usr/bin/python
# Copyright (c) 2017 Dell Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITH... | null | scripts/bin/base_nas_mac_config.py | base_nas_mac_config.py | py | 5,859 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cps.key_from_name",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nas_os_if_utils.log_err",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cps_object.CPSObject",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "nas_if... |
472179351 | import sys
from pathlib import Path
import pickle
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
util_dir = Path.cwd().parent.joinpath('Utility')
sys.path.insert(1, str(util_dir))
from Abstract import *
from Information import *
from Configuration import frcnn_config
def anchor_statistics(C):... | null | python/frcnn_mc_train/statistics_anchors.py | statistics_anchors.py | py | 4,316 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path.cwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numb... |
27001523 | from pymoo.operators.mutation.bitflip_mutation import BinaryBitflipMutation
import autograd.numpy as anp
from pymoo.model.problem import Problem
from pymoo.factory import get_crossover, get_mutation, get_sampling
from pymoo.optimize import minimize
from pymoo.algorithms.nsga2 import NSGA2
from sklearn.metrics import ma... | null | new_project/fastsklearnfeature/interactiveAutoML/new_bench/multiobjective/metalearning/strategies/evolution.py | evolution.py | py | 9,977 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "random.getrandbits",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "time.time",... |
462152952 | from django.conf import settings
from django.db import models
from .fields import GrenadeFileField
import os.path
def file_rename(instance, filename):
upload_to = 'tutorials'
ext = filename.split('.')[-1]
filename = '{}-{}.{}'.format(instance.cs_map, instance.pk, ext)
return os.path.join(upload_to, fi... | null | nades_list/models.py | models.py | py | 1,732 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.db.models.Model",
... |
592388006 | #!/usr/bin/env python3
import os
import sys
import pprint
import argparse
#!/usr/bin/env python
#langs = ["xal", "chv", "tat", "kaz", "kaz2", "alt", "bua", "kir", "tgk", "tyv", "kaa", "gag", "kum", "aze", "kjh"] #POSSIBLE languages, kaz2 is a second kaz translation of the Bible
def todict(langs):
langData = {} ... | null | apertium-tools/getBookNames.py | getBookNames.py | py | 1,248 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 33,
"usage_type": "call"
}
] |
490096076 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import cross_validation, neighbors, metrics, linear_model, learning_curve, naive_bayes, svm, ensemble, tree
import os
os.chdir("/home/choiboy9106/Desktop/Metis/Project McNulty")
# Reading in CSV File into Pandas DataFrame
df = pd.read... | null | classification_analysis.py | classification_analysis.py | py | 4,169 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.trai... |
563768723 | from flask import Flask, request, redirect, render_template, flash
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import Query
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://build-a-blog:buildablog@localhost:8889/build-a-blog'
app.config['SQLALCHE... | null | main.py | main.py | py | 2,199 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "flask... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.