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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
509013451 | bl_info = {
"name": "UE FBX Normals Tools",
"author": "Andreas Wiehn (isathar)",
"version": (1, 0, 2),
"blender": (2, 70, 0),
"location": "View3D > Toolbar",
"description": "Vertex normal editor + modified FBX exporter for "
"custom normals, tangents and tweaks for UDK/UE",
"warning": ""... | null | scripts/addons_extern/udk_fbx_tools/__init__.py | __init__.py | py | 28,850 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bpy.types",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "bpy.types",
"line_number": 226,
"usage_type": "attribute"
},
{
"api_name": "bpy.types",
"line_number": 251,
"usage_type": "attribute"
},
{
"api_name": "bpy.types",
"line_... |
221462381 | from django.template import RequestContext
from django.views.generic import View
from django.core.urlresolvers import resolve
from django.shortcuts import render, get_object_or_404, redirect
from portfolio.models import Project, Technology, ProjectImage,Feed
from django.http import HttpResponse
import urllib
from djang... | null | neosoft_portfolio/portfolio/views.py | views.py | py | 3,171 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "portfolio.models.Project",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 18,
"usage_type": "call"
},
... |
61406732 | import pygame
import os
import time
import random
from pygame.locals import *
pygame.init() #starts pygame
img_path = os.path.join('C:\Python34', 'trash.png') #where each sprite image is loaded from in the computer
img_path1 = os.path.join('C:\Python34', 'rubbish.png')
display_width = 500 #value of the width of... | null | internal environment program.py | internal environment program.py | py | 4,626 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": ... |
335350901 | class Node:
def __init__(self, value):
self.value = value
self.nextnode = None
def nth_to_last_node(n, head):
current = head
nodes = []
while current.nextnode != None:
nodes.append(current)
current = current.nextnode
nodes.append(current)
return nodes[-n]
"""
RUN THIS CELL TO TEST YOUR... | null | Udemy Python Algorithms Course/Linked Lists/Linked List Nth To Last Node.py | Linked List Nth To Last Node.py | py | 752 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nose.tools.assert_equal",
"line_number": 42,
"usage_type": "call"
}
] |
169855579 | # Calculated delta vs time from stored graphml files of solutions.
import glob
import networkx as nx
if __name__=='__main__':
label = 'results-syria'
path = 'results/'+label+'/*.graphml'
output = 'results/'+label+'/'+label+'delta-vs-time.csv'
files = glob.glob(path)
fout = open(output,'wb')
... | null | calc_stanford_delta_v_time.py | calc_stanford_delta_v_time.py | py | 648 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "glob.glob",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "networkx.read_graphml",
"line_number": 18,
"usage_type": "call"
}
] |
648704816 | from django.conf.urls import url
from users import views
from users.views import check_ip
from users.views import check_ip_
urlpatterns = [
url('^index/$', views.index, name='index'),
url(r'^my_redirect/$', views.my_redirect),
url(r'^set_cookie/$', views.set_cookie),
url(r'^get_cookie/$', views.get_co... | null | Django002B/users/urls.py | urls.py | py | 666 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "users.views.index",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "users.views",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.conf.urls... |
385025398 | import os
import shutil
from scripts.infrastructure import AttributesUtils
def createDir(dir):
os.mkdir(dir)
def deleteDir(dir):
if AttributesUtils.isValueValid(str(dir)):
shutil.rmtree(dir)
else:
print(str(dir) + " is invalid. Stopping execution. Check deleteDir method in the OSReposito... | null | nifi/volume/ci_cd_nifi_registry/scripts/repository/OSRepository.py | OSRepository.py | py | 330 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.mkdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scripts.infrastructure.AttributesUtils.isValueValid",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scripts.infrastructure.AttributesUtils",
"line_number": 11,
"usage_type": "na... |
99638717 | #!/usr/bin/env python3
import argparse
import csv
import math
import re
import shutil
from pathlib import Path
from bs4 import BeautifulSoup
from svg_effects import glow
from svg_render import render
parser = argparse.ArgumentParser(description='Generate icon theme from SVG template.')
parser.add_argum... | null | bin/generate_icons.py | generate_icons.py | py | 2,915 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_nu... |
311877643 | import numpy as np
import pandas as pd
import statsmodels.api as sm
import random
import plotly.express as px
import plotly.graph_objs as go
random.seed(42)
df = pd.read_csv('clean_data.csv', index_col=[0])
df = df[['age', 'er', 'pr', 'hr', 'hr_her_cat', 'mri_baseline', 'mri_dac', 'mri_interreg', 'mri_presurg', 'rfs... | null | multicollinearity/multicollinearity.py | multicollinearity.py | py | 1,943 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "statsmodels.api.OLS",
"l... |
272934293 | # setting camera parameters
import cv2
import datetime
cap = cv2.VideoCapture(0)
# (640, 480) 30 fps default
print(cap.get(cv2.CAP_PROP_FRAME_WIDTH), cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
print(cap.get(cv2.CAP_PROP_FPS))
# these would resize window if my cam wasn't ancient
# cap.set(3, 1280)
# cap.set(4, 720)
# print... | null | camparams.py | camparams.py | py | 1,217 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_na... |
582244472 | """This module contains async actions."""
import logging
from .. import async_actions
from .. import spider_metadata_cache_async_actions
from .. import tor_async_google_pubsub
from .. import queues_shared
_logger = logging.getLogger(__name__)
class AsyncAction(async_actions.AsyncAction):
"""Abstract base class... | null | cloudfeaster_services/queues/async_actions.py | async_actions.py | py | 13,113 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
}
] |
172769941 | import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorch_lightning.core.lightning import LightningModule
from tests.base.datasets import TrialMNIST
from tests.base.eval_model_optimizers import ConfigureOptimizersPool
from tests.base.eval_model_test_dataloaders import TestDataloaderVariations
fro... | null | tests/base/eval_model_template.py | eval_model_template.py | py | 2,652 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tests.base.eval_model_utils.ModelTemplateUtils",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tests.base.eval_model_train_steps.TrainingStepVariations",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "tests.base.eval_model_valid_steps.Validat... |
324213941 | """
Contains the REST API along with its models and controllers
"""
from flask import current_app
from flask.ext.restful import Api
from .authentication import authenticate, load_user
from savant.helpers.decorators import jwt_auth
from .controllers import User, DeckList, Deck, CardList, Card
def unauthorized(response)... | null | savant/api/__init__.py | __init__.py | py | 903 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.current_app.config.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.current_app.config",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 11,
"usage_type": "name"
},
{
"api_... |
430251007 | import cv2
import numpy as np
import os
from numba import njit
from tqdm import tqdm
from time import time
import matplotlib.pyplot as plt
def plot_distribution(res, label, y, save_name, save_dir):
figure=plt.figure(figsize=(10, 10))
for method in res:
plt.plot(res[method]["x"], res[method][y], labe... | null | keypoint_repeatability/src/utils.py | utils.py | py | 3,333 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "mat... |
589635596 | import math
import bpy
import mathutils
from bpy.types import Panel, UIList
from bpy.props import FloatProperty, IntProperty, BoolProperty, StringProperty, CollectionProperty, FloatVectorProperty, EnumProperty, IntVectorProperty
bl_info = \
{
"name" : "Swapper",
"author" : "JV",
"version" ... | null | Tools/BlenderScript/swapper/__init__002.py | __init__002.py | py | 6,848 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bpy.context",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "bpy.types",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "bpy.props.StringProperty",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "bpy.types",
... |
145310669 | """
GalSim realistic atmospheric PSF class
"""
import multiprocessing
import numpy as np
from scipy.optimize import bisect
import galsim
from lsst.sims.GalSimInterface import PSFbase
from .optical_system import OpticalZernikes, mock_deviations
class OptWF(object):
def __init__(self, rng, wavelength, gsparams=N... | null | python/desc/imsim/atmPSF.py | atmPSF.py | py | 10,499 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "galsim.UniformDeviate",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "optical_system.mock_deviations",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "optical_system.OpticalZernikes",
"line_number": 25,
"usage_type": "call"
},
{
... |
569842322 | from collections import defaultdict
import time
# Assumes values sorted
def brute_force_count_paths(values):
if len(values) <= 2:
return 1
total = 0
i = 1
while(i < len(values) and values[i] <= values[0]+3):
total += brute_force_count_paths(values[i:])
i+=1
return total
if ... | null | 10/solution.py | solution.py | py | 1,084 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 39,
"usage_type": "call"
}
] |
61854109 | import frida
import os
import sys
import argparse
def parse_hook(filename):
print('[*] Parsing hook: ' + filename)
hook = open(filename, 'r')
script = session.create_script(hook.read())
script.load()
if __name__ == '__main__':
try:
parser = argparse.ArgumentParser()
parser.add_ar... | null | frida-python-bindings-example/example-1/test.py | test.py | py | 809 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "frida.get_usb_device",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "frida.get_usb_device",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "fri... |
479190636 | from flask import ( # noqa
request,
redirect,
url_for,
jsonify,
current_app,
render_template
)
from flask.views import MethodView
from VJ.models import ProblemItem
from VJ.forms import SubmitForm
import json
class ProblemListView(MethodView):
template = 'problem/problem_list.html'
... | null | VJ/views/problem/problem.py | problem.py | py | 1,704 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.views.MethodView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "flask.current_app.config",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 23,
"usage_type": "name"
},
{
"api_name":... |
420251004 | # Databricks notebook source
# MAGIC %md
# MAGIC
# MAGIC DEMOGRAPHIC ADJUSTMENT FACTORS (DAFs)
# MAGIC ===================
# MAGIC
# MAGIC Use this notebook as a reference when querying the **Media Data Lake** for the **DAFs**.
# MAGIC
# MAGIC ----------
# MAGIC
# MAGIC **PURPOSE:**
# MAGIC > To return the Demograp... | null | notebooks/Users/theophilus.siameh.consultant@nielsen.com/Cookbooks (1)/Local_TV/D20.py | D20.py | py | 8,906 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 103,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 105,
"usage_type": "call"
},
{
"a... |
513013218 | import json
import dgl
import numpy as np
import torch
import torch.nn.functional as F
from data.gen_targets import QM9_SYMBOL_LIST
from src.data.loader import load_graph_data
from src.model.gnn import GraphNN
from src.utils import get_index_method, get_only_target_info
from train_script_parser import get_parser
de... | null | src/evaluation/perturbation_evaluator.py | perturbation_evaluator.py | py | 6,548 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "train_script_parser.get_parser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "src.model.gnn.GraphNN",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "src.d... |
201594873 | # -*- coding: utf-8 -*-
import numpy as np
from scipy.linalg import expm3
from base import ParamSearcher
class NesParamSearcher(ParamSearcher):
def __init__(self, config):
self.dim = config.get('dim')
self.popsize = config.get('popsize')
self.bounds = config.get('bounds')
self.... | null | bayesopt/nes.py | nes.py | py | 4,140 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base.ParamSearcher",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_numb... |
494475773 | from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
import json
import thread
import threading
import urlparse
from codalib.util import (getdotprefixed, utcnow, b62encode_loose,
b62decode_loose)
from codalib.crypto import urandstr
from codalib.notifica... | null | codalib/notifications/__init__.py | __init__.py | py | 4,103 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "thread.get_ident",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "codalib.util.utcnow",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "codalib.crypto.... |
630075679 | # -*- coding: utf-8 -*-
# Copyright 2018 Etsy 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
#
# Unless required by applicable law... | null | boundary_layer/logger.py | logger.py | py | 1,079 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "boundary_layer.VERSION_STRING",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "logging.StreamHandler",
"line_number": 24,
"usage_type": "call"
},
{
"api_nam... |
4690000 | # Copyright (c) 2019-2020 Simon Biggs
# Copyright (c) 2014-2020 James Kerns
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
# the rights to us... | null | lib/pymedphys/_experimental/vendor/pylinac_vendored/winstonlutz.py | winstonlutz.py | py | 15,527 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymedphys._experimental.vendor.pylinac_vendored._pylinac_installed.pylinac.image.ArrayImage",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "pymedphys._experimental.vendor.pylinac_vendored._pylinac_installed.pylinac.image",
"line_number": 83,
"usage_type": "attr... |
233863116 | """EKF end-to-end training script for visual odometry task."""
from tqdm.auto import tqdm
from lib import experiment_files, kitti, utils, validation_tracker
def main(config: kitti.experiment_config.EkfExperimentConfig) -> None:
experiment = experiment_files.ExperimentFiles(
identifier=config.experiment_... | null | train_kitti_ekf.py | train_kitti_ekf.py | py | 2,175 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.kitti.experiment_config",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "lib.kitti",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "lib.experiment_files.ExperimentFiles",
"line_number": 9,
"usage_type": "call"
},
{
"api_... |
336691954 | from django.shortcuts import render
from django.http import HttpResponse
from .models import Order,Customer,Product
# Create your views here.
def home(request):
orders = Order.objects.all()
customers = Customer.objects.all()
total_orders = orders.count()
delivered = orders.filter(status='Delivered').count()
p... | null | account/views.py | views.py | py | 964 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Order.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.Order.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.Order",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.C... |
616765316 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy import linspace, meshgrid, sqrt, gradient,exp
# from matplotlib.pyplot import quiver
# Définition du potentiel électrostatique créé par une charge q située en A
def Potentiel(q,A,x,y,sigma):
... | null | potentiel.py | potentiel.py | py | 1,033 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.exp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.gradient",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.sqrt",
"line_number": 26,
"usage_type": "call"
}
] |
218383658 | #data preparation for the ML model
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Activation
from keras.layers.core import Dense, Flatten
from keras.optimizers import Adam
from keras.metrics import categorical_crossentropy
from keras.preprocessing.image import ImageDataGen... | null | armywormcnn.py | armywormcnn.py | py | 3,823 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"lin... |
412695339 | # -*- coding:utf-8 -*-
#__author__:langzi
#__blog__:www.langzi.fun
import time
import asyncio
import aiohttp
import aiomultiprocess
import aiofiles
import multiprocessing
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
... | null | 资产收集/批量端口盲测/main.py | main.py | py | 2,554 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "asyncio.Semaphore",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "aiofiles.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "aiofiles.open",... |
274546557 | # -*- coding: utf-8 -*-
#
# title: Odds Converter
# description: This function converts any odds or probability
# parameters:
# odds: odds of event implied or probability
# cat_in: type of odds or implied probability
# 'us', American Odds
# 'dec', Decimal Odds
# 'frac', Fractional Odds
# ... | null | pybettor/convert_odds.py | convert_odds.py | py | 6,595 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.exit",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 49,
"usa... |
590945507 | import discord
from hourai.db import proto
class GuildProxy:
def __init__(self, bot, guild):
self.bot = bot
self.guild = guild
self._logging_config = None
self._validation_config = None
@property
def storage(self):
return self.bot.storage
async def get_loggi... | null | hourai/db/proxies.py | proxies.py | py | 2,581 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hourai.db.proto.LoggingConfig",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "hourai.db.proto",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "discord.Forbidden",
"line_number": 67,
"usage_type": "attribute"
}
] |
38187087 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 09:24:58 2015
"""
# from __future__ import division
import matplotlib
import pylab as pl
import seaborn as sbn
import h5py
import numpy as np
from collections import deque
from scipy.integrate import cumtrapz
f = h5py.File('/home/nicolas/datasave_validation.h5', 'r')
... | null | toolscripts/analysis.py | analysis.py | py | 3,533 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "h5py.File",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 25,... |
514010638 | from PyQt5 import QtWidgets
class Ui_Functions(QtWidgets.QMainWindow):
'''
Programó:
M. en I. Josue Emmanuel Cruz Barragan.
'''
def Fn_Inicializar(self):
############################
# Crear Tabla de Elementos #
############################
# Elem, A, E, Nodo... | null | CAPITULO 11/UI_Functions.py | UI_Functions.py | py | 5,365 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QTableWidgetItem",
"line_number": 28,
"usage_type": "call"
},
{
"a... |
134029087 | from django.contrib import admin
from sorl.thumbnail import get_thumbnail
# Register your models here.
from .models import ImageDisplay
class ImageDisplayAdmin(admin.ModelAdmin):
list_display = ('image_thumb', 'image_trip', 'order', 'width', 'height', 'crop_x', 'crop_y')
list_editable = ('order', 'width', 'height'... | null | galleries/admin.py | admin.py | py | 879 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sorl.thumbnail.get_thumbnail",
"line_number": 21,
"usage_type": "call"
},
{
... |
412763580 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import os.path
import sys
import argparse
import logging
import json
import gzip
sys.path.append(os.path.dirname(__file__))
#parse command line options
logger = logging.getLogger(__file__)
parser = argparse.ArgumentParser(description="")
parser.add_argumen... | null | AutoQA-ding_merged/tools/json_acc.py | json_acc.py | py | 2,421 | 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": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
69355998 | import collections
import json
import logging
import pickle
import random
import requests
import re
import os
import yaml
from textblob import TextBlob
from pprint import pprint
class BotState():
def __init__(self):
self.topics_count = {}
self.users_avg_polarity = {}
self.username_map = {}
outputs = []
crontab... | null | plugins/sentiment/sentiment.py | sentiment.py | py | 7,388 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_numbe... |
288788954 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
from mtcnn import MTCNN
detector = MTCNN()
WindowName = 'Face Detector'
cv2.namedWindow(WindowName, cv2.WINDOW_NORMAL)
cv2.setWindowProperty(WindowName, cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
cv2.setWindowProperty(WindowName, cv2.WND_PROP_FULLSCREEN,... | null | FaceDector-MTCNN/example_kai_video.py | example_kai_video.py | py | 1,483 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mtcnn.MTCNN",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.WINDOW_NORMAL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.setWindowProper... |
645087944 | from skimage import transform
import numpy as np
def preprocess_frame(frame):
# Arguments:
# frame: a single frame of the game outputted by VizDoom
# Returns:
# preprocessed_frame: a grayscale, 84*84 matrix
# Implements:
# A single frame is in RGB. Since we don't need color for ana... | null | Agent Architectures/Policy Gradients/preprocess_frame.py | preprocess_frame.py | py | 1,096 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.mean",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "skimage.transform.resize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "skimage.transform",
"line_number": 20,
"usage_type": "name"
}
] |
518119283 | from q import Que
import time
import datetime as datetime
TIME = 1 # should be hourly 10*60
from event import MarketEvent, SignalEvent, OrderEvent, FillEvent
from data import HistoricalCSV_DataHander
from strategy import BuyAndHoldStrategy
from portfolio import NaivePortfolio
from execution import SimulatedExecutionH... | null | EDB_Quant/loop.py | loop.py | py | 1,908 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "q.Que",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "data.HistoricalCSV_DataHander",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "portfolio.NaivePortfolio",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime... |
213396319 | import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
img=cv.imread('messi5.jpg',cv.IMREAD_GRAYSCALE)
canny=cv.Canny(img,100,200)#image,threshold1,threshold2 , lesser noise is there in this method as compared to image gradients
titles=['image','canny']
images=[img,canny]
for i in range(2):
plt... | null | canny.py | canny.py | py | 438 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot... |
473657941 | import argparse
import praw
import time
import models
import pdb
def refresh_subreddit():
user_agent = 'refresh-subreddit'
r = praw.Reddit(user_agent=user_agent)
subreddit = r.get_subreddit(args.subreddit)
submissions = subreddit.get_new(limit=None)
for submission in submissions:
try:
... | null | refresh-subreddit.py | refresh-subreddit.py | py | 1,290 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "praw.Reddit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Submission.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Submission",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "models.Submis... |
237641761 | import os
from traits.api import *
from traitsui.api import *
from traitsui.extras.checkbox_column import CheckboxColumn
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection, LineCollection
from matplotlib.colors import colorConverter
import matplotlib.pyplot as plt
import matplotli... | null | tree_editors.py | tree_editors.py | py | 3,017 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "main.WorkSpace",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "project.Project",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "experiment.SpectrumExperiment",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "experime... |
286526794 | """
ScanCommand class for SubarrayNodeLow
"""
# Standard Python imports
import json
# Tango imports
import tango
from ska.base import SKASubarray
# Additional import
from ska.base.commands import ResultCode
from tango import DevFailed
from tmc.common.tango_client import TangoClient
from tmc.common.tango_server_helper... | null | temp_src/ska_tmc_subarraynode_low/scan_command.py | scan_command.py | py | 5,123 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ska.base.SKASubarray.ScanCommand",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "ska.base.SKASubarray",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tmc.common.tango_server_helper.TangoServerHelper.get_instance",
"line_number": 58,... |
589087334 | from __future__ import print_function
import mxnet as mx
import glob
import argparse
import os
import time
try:
import multiprocessing
except ImportError:
multiprocessing = None
def parse_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
de... | null | create_rec.py | create_rec.py | py | 2,449 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 38,
"usage_type": "call"
},
{
"api... |
581737578 | import json
import falcon
import data
from analyses.dbscan import DBScan
from analyses.kmeans import kmean, elbow
from analyses.nearest_neighbours import knn
from analyses.pearsons import pearson
from analyses.spearmans import spearman
indent = 2
class Kmeans(object):
def on_get(self, req, resp):
fina... | null | views/views.py | views.py | py | 2,550 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "analyses.kmeans.kmean.final_resul_kmeans",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "analyses.kmeans.kmean",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_nam... |
385189793 | """
A bot that responds to mentions on reddit with an emojipasta
version of the parent of that mention.
"""
import time
import sys
from praw.models import Comment, Submission
import praw.exceptions
from emojipasta.util import get_reddit
from emojipasta.generator import EmojipastaGenerator
SECONDS_BETWEEN_RUNS = 60
... | null | build/lib/emojipasta/bot/emojipastabot.py | emojipastabot.py | py | 5,570 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "praw.models.Comment",
"line_number": 56,
"usage_type": "argument"
},
{
"api_name": "emojipasta.util",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "emojipasta.util",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "emojipasta.... |
376075576 | #!/usr/bin/env python
#
# tournament.py -- implementation of a Swiss-system tournament
#
import psycopg2
import bleach
def connect():
""" Connect to the PostgreSQL tournament database.
Returns a database connection and cursor object."""
try:
db = psycopg2.connect("dbname=tournament")
... | null | vagrant/tournament/tournament.py | tournament.py | py | 6,679 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "psycopg2.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bleach.clean",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "bleach.clean",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "bleach.clean",
"line_n... |
605774989 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 11 17:10:04 2019
# Credit Card Fraud Detection
# Random Forest
@author: Vipin Dhonkaria
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('creditcard.csv')
X = dataset.iloc[:, 1:-1].... | null | randomforest.py | randomforest.py | py | 1,788 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 26,
"usage_type": "call"
... |
206057361 | import re
__author__ = 'zjb'
__author__ = 'Tejas Raval'
from collections import namedtuple
Entry = namedtuple('Entry', ('key', 'value'))
'''
To make sure that the DELETED sentinel does not match
anything we actually want to have in the table, make it
a unique (content-free!) object.
'''
class _delobj: pass
DELETED = ... | null | Lab7/hashmap.py | hashmap.py | py | 6,576 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.namedtuple",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 196,
"usage_type": "call"
}
] |
462027730 | # wiesliam
# these should be the only imports you need
import sys
import sqlite3
from sqlite3 import Error
# write your code here
# usage should be
# python3 part2.py customers
# python3 part2.py employees
# python3 part2.py orders cust=<customer id>
# python3 part2.py orders emp=<employee last name>
def list_o... | null | part2.py | part2.py | py | 2,498 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_numb... |
418131540 |
import functools
import logging
import operator
import re
import typing as t
from .message import Message
from .connection import Connection
_LOG = logging.getLogger(__name__)
CONDITION_OPERATORS = {
# '>': lambda arg: functools.partial(),
'=': lambda arg: functools.partial(operator.eq, arg),
# '!=': la... | null | maildaemon/message_filter.py | message_filter.py | py | 6,290 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "operator.eq",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
... |
557803644 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from selenium import webdriver
from _configs._configs import Configs
from selenium.webdriver.chrome.options import Options
class Basic_settings(Configs):
def __init__(self, *args, **kwargs):
options = webdriver.ChromeOptions()
# options.add_argument("us... | null | basic.py | basic.py | py | 787 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "_configs._configs.Configs",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_... |
556663607 | #!/usr/bin/python3
"""
Utility for building a map using installed Source SDK tools.
Call with -h or --help to see usage information.
Examples:
# Creates/installs/runs .bsp in same dir
python buildbsp.py --game tf2 mymap.vmf
# Creates/installs .bsp but does not run
python buildbsp.py --game css --no-run my... | null | tools/buildbsp.py | buildbsp.py | py | 10,022 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.platform.startswith",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "sys.platform.startswith",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sys... |
4305821 | import json
import scrapy
from scrapy.loader import ItemLoader
from ..items import ErstebankmeItem
from itemloaders.processors import TakeFirst
import requests
url = "https://www.erstebank.me/bin/erstegroup/gemesgapi/feature/gem_site_me_www-erstebank-me-me-es7/,"
base_payload = "{\"filter\":[{\"key\":\"path\",\"v... | null | erstebankme/spiders/spider.py | spider.py | py | 2,648 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "requests.request",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "scrapy.loader.ItemLoad... |
57398738 | import os
import ncClasses.ncField as ncField
from ncClasses.subdomains import setSSI
from datetime import datetime, timedelta
import numpy as np
os.chdir('00_newScripts/')
from functions import saveObj
ress = ['4.4', '2.2', '1.1']
ress = ['4.4']
#modes = ['', 'f']
modes = ['f']
i_subdomain = 9
ssI, domainName = se... | null | 00_newScripts/06_00_test.py | 06_00_test.py | py | 3,373 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ncClasses.subdomains.setSSI",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
... |
654365079 | import maya.cmds as cmds
# The "make_ik" script makes a control set up for a joint chain with 3 joints.
# When the script creates the pole vector contraint control it moves it triangularly from the middle point of the first and last joint.
# The script takes one argument which renames the joint chain and all of th... | null | Tools/MayaTools/MakeIK_Hite.py | MakeIK_Hite.py | py | 4,177 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "maya.cmds.select",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "maya.cmds.ls",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number"... |
107820784 | # -*- coding: utf-8 -*-
##########################################################################
#
# Start/Stop your own Minecraft Server
#
##########################################################################
"""
This script start/stop the Minecraft server.
"""
import argparse
import subprocess
import sys
fro... | null | ctl_minecraft_server.py | ctl_minecraft_server.py | py | 3,114 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 46,
"usage_type": "argument"
},
{
"api_name": "logging.S... |
349894697 | """empty message
Revision ID: b0d20dba7d11
Revises: eb08f2eba2bb
Create Date: 2020-07-07 20:27:23.161512
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b0d20dba7d11'
down_revision = 'eb08f2eba2bb'
branch_labels = None
depends_on = None
def upgrade():
# ... | null | projects/01_fyyur/starter_code/migrations/versions/b0d20dba7d11_.py | b0d20dba7d11_.py | py | 2,614 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
503416745 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.feature_selection import VarianceThreshold
def prepare(X, index):
X = X[index, :]
#idx = np.nonzero(X)
#X = X[idx]
X = pd.DataFrame(X)
return X
X_train = np.load('./data/X_train.npy')
X_train = X_train[:,0:9000]
y_train = np.l... | null | project3_test/view.py | view.py | py | 838 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_numb... |
295148668 | from nn_models import DQN
from memory import ReplayMemory
from dqnagent import DQNAgent
from ddqnagent import DDQNAgent
from checkpoint import save_checkpoint, load_checkpoint
from atari_wrappers import make_atari, wrap_deepmind, clip_reward
import torch
import numpy as np
import gym
import os
# set environ... | null | train.py | train.py | py | 4,569 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "atari_wrappers.make_atari",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "atari_wrappers.wrap_deepmind",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "t... |
214023842 | from django.views.generic import TemplateView
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.contrib.sitemaps.views import sitemap
from .sitemap import DinamicSitemap
from . import views
class QACreate(object):
pass
sitemaps = {'articles': DinamicSitemap}
... | null | main/urls.py | urls.py | py | 1,437 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sitemap.DinamicSitemap",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.url",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "djan... |
59249865 | """
homeassistant.components.notify.slack
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Slack platform for notify component.
Configuration:
To use the Slack notifier you will need to add something like the following
to your configuration.yaml file.
notify:
platform: slack
api_key: ABCDEFGHJKLMNOPQRSTUVXYZ
defaul... | null | homeassistant/components/notify/slack.py | slack.py | py | 2,602 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "homeassistant.helpers.validate_config",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "homeassistant.components.notify.DOMAIN",
"line_number": 44,
"usage_type": "name"
... |
283260823 | import unittest, webapp2, webtest
from google.appengine.ext import testbed
from app.handlers.main import MainHandler
class MainTest(unittest.TestCase):
def setUp(self):
app = webapp2.WSGIApplication([(r'/([a-zA-Z0-9-_]*)', MainHandler)])
self.testapp = webtest.TestApp(app)
self.testbed... | null | test/functional/test_main.py | test_main.py | py | 1,770 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "app.handlers.main",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "webapp2.WSGIApplication",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.han... |
44661963 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from lxml import html
import requests
import xml.etree.ElementTree as ET
import random
import principiosActivos
import generadoresRandom
import laboratoriosRandom
import sacandoMedicamentos
#creoxmlalmacenes
numeroAlmacenes = 5
registroAlmacenes = ET.Element("root")
for i... | null | main.py | main.py | py | 3,361 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xml.etree.ElementTree.Element",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "generadoresRandom.AlmacenLoco.generarNombreAlmacen",
"line_number": 17,
"usage_type":... |
375066084 | #!/usr/bin/env python3
#-*-coding: utf-8-*-
# Version: 0.1
# Author: Song Huang <huangxiaohen2738@gmail.com>
# License: Copyright(c) 2015 Song.Huang
# Summary:
import asyncio
import aiomysql
import functools
from enum import Enum
class DBOperator(Enum):
SYNC, ROW, DATASET = range(3)
__pool = None
async def i... | null | src/lib/db.py | db.py | py | 1,204 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "aiomysql.create_pool",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "functools.parti... |
254327245 | from os import path
from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, Filters, CallbackQueryHandler
from cmd_base import Chall, get_options_keyboard, DATA_DIR
SHOWS_CHOSEN_CHALL = range(1)
def show_challs(update, context):
msg = update.message
user_id = msg.from_user.id
... | null | show_cmd.py | show_cmd.py | py | 1,769 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cmd_base.get_options_keyboard",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cmd_base.DATA_DIR",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "os.p... |
481750108 | from django.contrib.gis.db import models
class GWFlowSystem(models.Model):
"""
7.6.17 GW_FlowSystem
Flow path from recharge to discharge location, through hydrogeological units. It is
related to a fluid body, and consists of a collection or aggregation of at least two specific
flows, as well as po... | null | models/flow/gw_flow_system.py | gw_flow_system.py | py | 700 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.gis.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.gis.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.contrib.gis.db.models.GeometryField",
"line_number": 11,
"usage... |
613983503 | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 16 14:56:41 2016
@author: jtmartin
"""
import numpy as np
import pandas as pd
import requests
from bs4 import BeautifulSoup
from datetime import datetime, date
import re, json
import sys
path = "C:/Users/jtmartin/Documents/College Football/Scrape ESPN/"
ur... | null | Update Wins.py | Update Wins.py | py | 3,935 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": ... |
220981022 | import json
import io
import gzip
from types import SimpleNamespace
import boto3
import pandas as pd
import sqlalchemy
from sqlalchemy.sql import text
from flask import Flask, request
with open('../auth/auth.json') as f:
auth = SimpleNamespace(**json.load(f))
s3client = boto3.client('s3', aws_access_key_id=auth.... | null | main.py | main.py | py | 3,511 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "types.SimpleNamespace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine... |
137466139 | # encoding: utf-8
# author: Yicheng Wang
# contact: wyc@whu.edu.cn
# datetime:2020/10/10 10:32
"""
class-wise estimation,
moving-average,
biased estimation,
bias-corrected,
stpds via total running_mean,
.../(eps + stpd),
no bias
"""
import torch
from torch.nn.modules.batchnorm import _BatchNorm as origin_BN
from warn... | null | SampleRateLearning/stable_batchnorm/batchnorm19.py | batchnorm19.py | py | 5,556 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.modules.batchnorm._BatchNorm",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "torch.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.l... |
452701255 | import argparse, sys
from pybicl.io import BedFile
import pysam
def parse_args(args):
parser = argparse.ArgumentParser()
base_group = parser.add_argument_group("Base")
base_group.add_argument("-i", "--input", type=str, dest="input", metavar="input.bed12", required=True)
base_group.add_argument("-g", "... | null | pybicl/tools/scan_utr_orf.py | scan_utr_orf.py | py | 2,754 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pysam.FastaFile",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "pybicl.io.BedFile",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pybicl.io.Be... |
47599363 | from .dataset import SNLIDataset, MNLIDataset, \
SNLIHaohanDataset, MNLIStressTestDataset, MNLIHansDataset, MNLIHansTrainDataset, MNLILenDataset, \
SNLIBreakDataset, SNLISwapDataset, MNLISwapDataset, SICKDataset, \
QQPWangDataset, QQPPawsDataset, WikiPawsDataset, MNLINoSubsetDataset
tasks = {
'MNLI': ... | null | src/task.py | task.py | py | 825 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dataset.MNLIDataset",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dataset.MNLIStressTestDataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dataset.MNLIHansDataset",
"line_number": 9,
"usage_type": "name"
},
{
"api_name":... |
635507945 | ## Default modules imported. Import more if you need to.
from scipy import linalg
import numpy as np
## Fill out these functions yourself
# Fits a homography between pairs of pts
# pts: Nx4 array of (x,y,x',y') pairs of N >= 4 points
# Return homography that maps from (x,y) to (x',y')
#
# Can use np.linalg.svd
def... | null | calibration/homographyMat_caculator/homographyMatMy.py | homographyMatMy.py | py | 2,941 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.matrix",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.svd",
"line_n... |
131433469 | import logging
logging.basicConfig(format='%(name)s - %(levelname)s - %(message)s',
level=logging.INFO,
filename='bot.log'
)
from ephem import *
import datetime
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
def greet... | null | bot.py | bot.py | py | 9,125 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 206,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
447573552 | import gensim
import remove_punctuations
import tokenize_input_text
from check_candidate_type import is_candidate_pos_type
FILE_FACEBOOK_WORD_VECTORS = './../datasets/wiki.en.vec'
class LanguageModelReplacement:
model = None
def __init__(self):
self.model = gensim.models.KeyedVectors.load_word2vec_... | null | src/language_model_replacements.py | language_model_replacements.py | py | 1,684 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gensim.models.KeyedVectors.load_word2vec_format",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "gensim.models",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "check_candidate_type.is_candidate_pos_type",
"line_number": 19,
"usage... |
294758179 | import socket
import rsa
import Crypto
import sys
import select
import time
import random as rd
from Crypto.PublicKey import RSA
rd.seed(0)
host_s = '10.237.27.68'
myID = 'b'
my_private_key = rsa.key.PrivateKey._load_pkcs1_pem(open('gen/'+myID+'_private_key.pem','rb').read())
host_b = '10.194.55.154'
... | null | Network Security/Public Key Distribution Server/serverb.py | serverb.py | py | 2,575 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rsa.key.PrivateKey._load_pkcs1_pem",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rsa.key",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Crypto.Pu... |
367152121 | import webapp2
import cgi
import re
import head
title = "Rot13"
form = """
<form method="post">
<textarea name="text">%s</textarea><br>
<input type=submit value="rotate">
</form>
"""
alpha = "abcdefghijklmnopqrstuvwxyz"
alphA = alpha.upper()
rep = {alpha[i]:alpha[(i+13)%26] for i in xrange(26)}
rep.update({alphA[i]... | null | rot13.py | rot13.py | py | 1,061 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.escape",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "webapp2.RequestHandler",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "re.escape",
"lin... |
303811403 | import argparse
import torch
import torch.nn as nn
import numpy as np
import os
import pickle
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from data_loader import get_loader
from build_vocab import Vocabulary
from model import EncoderCNN, DecoderRNN
from torch.autograd import Variable
from... | null | MED/train.py | train.py | py | 5,538 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.switch_backend",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.p... |
74475115 | # -*- coding: utf-8 -*-
"""
Bulletin generator for the UZ Hydromet.
It fills the bulletin template in imomo.utils.xls.templates/uz_template.xlsx.
"""
import string
import datetime
from openpyxl import load_workbook
from imomo.utils.xls.templates import load_template
from imomo.utils.xls.writers.column_entry import cr... | null | imomo/utils/xls/writers/uz_bulletin.py | uz_bulletin.py | py | 4,763 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "imomo.utils.xls.writers.column_entry.create_column_entry",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "imomo.utils.xls.writers.column_entry.create_column_entry",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "imomo.utils.xls.writers.column_... |
621848416 | import os
import sys
import re
import glob
import cv2
from PIL import Image
import numpy as np
# width方向にリサイズ
def vconcat_resize_min(im_list, interpolation=cv2.INTER_CUBIC):
w_min = min(im.shape[1] for im in im_list)
im_list_resize = [
cv2.resize(
im, (w_min, int(im.shape[0] * w_min / im.... | null | src/main.py | main.py | py | 1,286 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.INTER_CUBIC",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.vconcat",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_CUBIC",
"li... |
364352179 | # -*- coding: utf-8 -*-
import os, sys
import datetime
import gridfs
import pymongo
reload(sys)
sys.setdefaultencoding("utf-8")
sys.path.append(os.path.join(os.path.split(os.path.realpath(__file__))[0], '../../util'))
import db
import loghelper
sys.path.append(os.path.join(os.path.split(os.path.realpath(__file__))[0], ... | null | data/spider2/datacheck/data_report2.py | data_report2.py | py | 18,275 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
642372969 | """
robot trade service for user trade order
"""
import time, logging
from .. import task, rpc
_Dealt = {
"已成": "tdeal",
"已撤": "tcanceled",
"部撤": "pcanceled",
"撤废": "fcanceled",
"废单": "dropped"
}
class _Repr:
def __init__(self, **filters):
"""
init a represent object
... | null | app/svc/app/atm/tasks/trade.py | trade.py | py | 11,161 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.error",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 130,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_num... |
356926207 | #!/usr/bin/env python3
import sys
import itertools
args = sys.argv
if len(args) < 3:
print('Usage:', args[0], 'Seconds', 'POV', 'Out')
sys.exit(1)
#CREATE MAKEFLOW FILE FOR RUBIKS MOVIE
seconds = int(args[1])
pov = str(args[2])
out = str(args[3])
frames = seconds * 10
frames_l = reversed(range(1,frames + ... | null | homework14/makeflow/create_make.py | create_make.py | py | 865 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "itertools.cycle",
"line_num... |
611826317 | # -*-coding:utf-8-*-
from elasticsearch_dsl import Date, analyzer, Keyword, Text, Document
from elasticsearch_dsl.connections import connections # 导入连接elasticsearch(搜索引擎)服务器方法
connections.create_connection(hosts=['127.0.0.1'])
ik_analyzer = analyzer('ik_max_word')
class cnblogsType(Document): ... | null | cnblog/elasticsearch_orm.py | elasticsearch_orm.py | py | 1,113 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "elasticsearch_dsl.connections.connections.create_connection",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "elasticsearch_dsl.connections.connections",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "elasticsearch_dsl.analyzer",
"line_number... |
513876568 | #!/usr/bin/env python
"""Optimized workload ID = 2
This script is the optimized version of the baseline workload 'introduction_to_manual_feature_engineering' (ID = 2)
which utilizes our Experiment Graph for optimizing the workload
Original notebook is located here:
https://www.kaggle.com/willkoehrsen/introductio... | null | code/collaborative-optimizer/paper/experiment_workloads/kaggle_home_credit/optimized/introduction_to_manual_feature_engineering.py | introduction_to_manual_feature_engineering.py | py | 27,515 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "experiment_graph.workload.Workload",
"line_number": 39,
"usage_type": "name"
},
{
"api_nam... |
399111701 | #!/usr/bin/env python
from Crypto.Cipher import ARC2
import itertools
def mitmFilter(plain, cipher, key):
enc = ARC2.new(key[0], ARC2.MODE_ECB).encrypt(plain)
dec = ARC2.new(key[1], ARC2.MODE_ECB).decrypt(cipher)
return enc == dec
def mitmPair(plain, cipher, key):
c = ARC2.new(key, ARC2.MODE_ECB)
... | null | cst/writeups/cyberstakesonline_2014/crc2/crack.py | crack.py | py | 1,578 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Crypto.Cipher.ARC2.new",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.ARC2",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.ARC2.MODE_ECB",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name"... |
520897685 | ### THIS FILE HANDLES USER AUTHORIZATION TO SPOTIFY AND MANAGES TOKEN ON MONGODB ###
import datetime
import spotipy
from spotipy.util import *
from spotipy.oauth2 import *
from flask import redirect
from settings import *
from models import *
sp_oauth = oauth2.SpotifyOAuth(client_id=CLIENT_ID, client_secret=CLIENT_S... | null | spotipy_mod.py | spotipy_mod.py | py | 2,607 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.redirect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "spotipy.Spotify",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
648893582 | import pandas as pd
import xml.etree.ElementTree as ET
import os
from bs4 import BeautifulSoup
pd.set_option('display.max_columns', None)
# this file processes xml's present in Content folder of a course to a dataframe in the form:
# ['pageId', 'elementid', 'type', 'value'] value contains text
def process_text(conten... | null | process_text.py | process_text.py | py | 2,964 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.set_option",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "xml.etree.E... |
152545537 | import requests
def lambda_handler(event, context):
"""
This function updates a Salesforce record
:param event: takes the following form:
{
'access_token' (required): your access token for OAuth in Salesforce
'uri' (required) your uri for your salesforce org
'so... | null | lambdas/update_sf_record.py | update_sf_record.py | py | 1,043 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 28,
"usage_type": "call"
}
] |
324292008 | import asyncio
import os
import random
from time import strftime, localtime
import discord
from __main__ import send_cmd_help
from discord.ext import commands
from .utils import checks
from .utils.dataIO import dataIO
kill_message = ["Finalement {0} en avait dans la cervelle !",
"Maintenant que {0} e... | null | roulette/roulette.py | roulette.py | py | 17,036 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.dataIO.dataIO.load_json",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "utils.dataIO.dataIO",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "__main__.send_cmd_help",
"line_number": 80,
"usage_type": "call"
},
{
"api_name... |
627770165 | import argparse
import numpy as np
import pickle
import datetime
import os
from attacks import GSM
from utils import load_model, load_data
def main(model_name, num_attacks, max_distance,
batch_size, steps, target_class, orig_class, verbose):
net, _, _ = load_model(model_name)
data_loader = load_data... | null | fgsm.py | fgsm.py | py | 2,487 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.load_model",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.load_data",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "attacks.GSM",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"li... |
106098170 | from keras.regularizers import l2
from data_process import *
from keras.layers import *
from keras.models import *
from keras import callbacks
from kutilities.layers import *
from capsule_layer import *
(x_train, y_train), (x_test, y_test) = data_load_and_preprocess()
print("Training entries: {}, labels: {}".format(le... | null | rnn-att.py | rnn-att.py | py | 1,391 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.callbacks.CSVLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "keras.callbacks",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "keras.regularizers.l2",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras... |
168431546 | from django.conf.urls import url
from . import views
app_name = 'an8'
urlpatterns = [
# /
url(r'^$', views.IndexView.as_view(), name='index'),
# /login/
url(r'^login/$', views.LogInView.as_view(), name='login'),
# /logout/
url(r'^logout/$', views.logout_view, name='logout'),
# /stock/add/
... | null | an8/an8/urls.py | urls.py | py | 651 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.c... |
285653533 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import cgi
import cgitb; cgitb.enable()
import db
print("Content-Type: text/html; charset=utf-8\r\n\r\n")
form = cgi.FieldStorage()
avdb = db.Avistamiento('127.0.0.1', 'root', "admin", "tarea2")
# Aqui hay documentacion de como manejar el fieldStorage del cgi y obtener lo... | null | Tarea2 - Copy/cgi-bin/guardar_avistamiento.py | guardar_avistamiento.py | py | 1,238 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cgitb.enable",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cgi.FieldStorage",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "db.Avistamiento",
"line_number": 12,
"usage_type": "call"
}
] |
392265130 | import requests
import time
# Scenario, getting a list of shops with specific information
def rest():
url = "https://network-mock.azurewebsites.net/contact/5ddcbf771d27d6250074c653"
response = requests.request(
"GET", url)
return len(response.content), response.status_code
def graphql():
... | null | evaluation_script/single_contact_partial.py | single_contact_partial.py | py | 3,162 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.request",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_num... |
97469385 | from collections import OrderedDict
from levenshteinDistance import levenshtein as ld
#------------------------
# shared variables:
#------------------------
words = OrderedDict()
words['Eng'] = ''
words['Ger'] = ''
words['Por'] = ''
words['Pol'] = ''
outputFilename = 'output.txt'
allophones = {
'aeiou' : 'a',
... | null | miniExamples/gerPorPol/evaluate.py | evaluate.py | py | 7,320 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "levenshteinDistance.levenshtein",
"line_number": 68,
"usage_type": "call"
}
] |
99755516 | import gensim
from gensim.parsing.preprocessing import strip_non_alphanum, stem_text, preprocess_string
from gensim.parsing.preprocessing import remove_stopwords, strip_punctuation
from gensim.utils import simple_preprocess
from gensim.models.callbacks import CallbackAny2Vec
import numpy as np
from scipy.spatial.distan... | null | token_similarities.py | token_similarities.py | py | 2,521 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gensim.models.callbacks.CallbackAny2Vec",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "gensim.models.Word2Vec.load",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "gensim.models",
"line_number": 45,
"usage_type": "attribute"
},
{... |
54998801 | import pytest
from sopel_help import providers
MOCK_RESULT = 'https://example.com/clbin-content'
MOCK_URL = 'https://clbin.com/'
def test_publish(requests_mock):
requests_mock.post(MOCK_URL, text=MOCK_RESULT)
# this provider doesn't need any bot setup to work
provider = providers.CLBinPublisher()
p... | null | tests/test_providers_clbin.py | test_providers_clbin.py | py | 905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sopel_help.providers.CLBinPublisher",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sopel_help.providers",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sopel_help.providers.CLBinPublisher",
"line_number": 27,
"usage_type": "call"
... |
336140149 | import scrapy
from scrapy.spider import Spider
class RedditSpider(Spider):
name = 'redditspider'
start_urls = ['https://www.reddit.com/r/MachineLearning/',]
def parse(self, response):
for i in response.xpath('//*[@id="siteTable"]/div'): # 从取出的标签找内容
if i.xpath('div[2]/p[1]/span[1]/te... | null | reddit/reddit/spiders/redditspider.py | redditspider.py | py | 1,239 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.spider.Spider",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "scrapy.Request",
"line_number": 24,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.