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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70910517 | import numpy as np
import numpy.matlib
import matplotlib.pyplot as plt
import Dataset as dset
import MLP as mlp
#######################################################################
# 1.f #
# classification with synthetic/real datasets ... | null | study/project-jupyter/pytorch/Lab1-2,3/MLP_Test_SP.py | MLP_Test_SP.py | py | 1,914 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Dataset.dset_SP",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "MLP.nn_MSECriterion",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "MLP.nn_2layerNet",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "MLP.nn_ReLU",
... |
566030144 | import argparse
import sys
import logging
logger = logging.getLogger(__name__)
from bayes_gain_screens.utils import wrap
from bayes_gain_screens.plotting import plot_vornoi_map
from bayes_gain_screens.frames import ENU
from h5parm import DataPack
import astropy.units as au
import astropy.coordinates as ac
import pylab... | null | bin/plot_simulation.py | plot_simulation.py | py | 4,864 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "h5parm.DataPack",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
403352180 |
from flask import Flask, render_template, request
from datetime import datetime
#from jinja2 import
app = Flask(__name__) #'__main__'
#app.config.from_object(__name__)
#app.config['SECRET_KEY'] = '123455677889900'
@app.route('/') #inut here is empty end point. It means the last character of this example URL: www.m... | null | src/app.py | app.py | py | 2,398 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
328121302 | # ~~~~~~~ http server ~~~~~~~~~
import gevent.pywsgi as wsgi
from gevent.pool import Pool
from groot import logging
from groot.commons.green import SingletonGreenExecutor
from groot.config import Configuration
from .app import GrootWebApp
DEFAULT_HTTP_CONCURRENCY = 10
logger = logging.getLogger(__name__)
class Gr... | null | groot/web/server.py | server.py | py | 956 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "groot.logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "groot.logging",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "groot.commons.green.SingletonGreenExecutor",
"line_number": 16,
"usage_type": "name"
},
{
"... |
616047198 | import json
import logging
from channels.generic.websocket import AsyncJsonWebsocketConsumer
log = logging.getLogger(__name__)
class NotificationTaskConsumer(AsyncJsonWebsocketConsumer):
"""
real time notification to browser
"""
async def connect(self):
await self.accept()
await self... | null | adopt/apps/feeds/consumers.py | consumers.py | py | 948 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "channels.generic.websocket.AsyncJsonWebsocketConsumer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"... |
326775022 | from collections import defaultdict
from datetime import datetime
import json
import logging
from com.dub.objects.Audio import Audio
from com.dub.objects.User import User
from com.dub.objects.Video import Video
from google.appengine.ext import ndb
# import UserDetailsAccess
class AdminDataAccess:
def... | null | src/com/dub/database/AdminDataAccess.py | AdminDataAccess.py | py | 7,010 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.ndb.Key",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 23,
"usage_type": "name"
},
{
"api... |
515518504 | from flask import Flask, request
import pymysql
import json
import collections
import httplib2
app = Flask(__name__)
@app.route('/requestdata', methods=["POST"])
def ready_data():
return select_data(1, 1, 1, 1)
@app.route('/mypost')
def mypost():
return select_data(1, 2, exchangeuserid(request.values.ge... | null | app.py | app.py | py | 7,211 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.values.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request.values",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
73325336 | import requests
import json
import datetime
import argparse
USER = "appia@doubledown.com"
PWD = "appia123"
START = (datetime.date.today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d')
TODAY = datetime.date.today().strftime('%Y-%m-%d')
BASE_URL = "https://via.appia.com/pss/api/report/advertiser/performance?start... | null | partners/appia/bin/appia.py | appia.py | py | 781 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.date.today",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
292996682 | #!/usr/local/bin/python
# -*- Encoding: windows-1251 -*-
import codecs
import urllib
import MySQLdb
import MySQLdb.cursors
import sql
_from_utf8 = codecs.getdecoder("utf8")
def syntax_search_process(query, output):
converted_query = _query_param_to_ustr(_from_utf8, query)
db = MySQLdb.connect(user="synt... | null | search/syntax/syntax_search.py | syntax_search.py | py | 978 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "codecs.getdecoder",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sql.Search",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.unquote",
"li... |
50312567 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import shutil
import pymysql
import sys
def get_size(start_path = '.'):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)
total_size += os.path.getsize(fp... | null | distribution_platform_clearner.py | distribution_platform_clearner.py | py | 6,320 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.walk",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.getsize",
"line_number"... |
603207236 | # fireworks
import random # module providing the randint function
import time # time module to delay after drawing five fireworks
import turtle # turtle module for drawing fireworks
#### Initialize variables used in the program
# The following width and height match the GIF used by the program
screen_width,... | null | fireworks.py | fireworks.py | py | 3,171 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "turtle.reset",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "turtle.setup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "turtle.bgpic",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "turtle.width",
"line_numbe... |
475698548 | from .models import Membership
from datetime import datetime
def get_membership(request):
membership = None
try:
membership = Membership.objects.get(user=request.user)
except (Membership.DoesNotExist, TypeError) as e:
print("Membership not available for user: ", e)
return membership
... | null | membership/contexts.py | contexts.py | py | 526 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Membership.objects.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Membership.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.Membership",
"line_number": 8,
"usage_type": "name"
},
{
"api_n... |
207931832 | from __future__ import print_function
from PIL import Image
import numpy as np
def save(arr, path):
# save an image
newarr = 0.+arr
newarr -= min(map(min, arr))
newarr *= 255. / (max(map(max, arr)))
Image.fromarray(arr).convert('L').save(path)
# load input file into numpy array
orig = Image.open... | null | live/live.py | live.py | py | 1,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.fromarray",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_nu... |
206743019 | from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
import os
salt = os.urandom(32)
kdf = PBKDF2HMAC(algorithm=hashes.SHA... | null | II KOLOK/aes1.py | aes1.py | py | 1,196 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.urandom",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.kdf.pbkdf2.PBKDF2HMAC",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.hashes.SHA256",
"line_number": 9,
"usage_typ... |
629514032 | import urllib3 as url
import ctypes
import json
import os
from random import randint
from bs4 import BeautifulSoup
#=================================================================================================================================================================
def changeit(rname):
url.disable_warning... | null | wallpaper changer.py | wallpaper changer.py | py | 3,768 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib3.PoolManager",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.pat... |
260950372 | # Django
from django.core.management.base import BaseCommand, CommandError
# Project
from globalvars.models import Global
class Command(BaseCommand):
help = "help"
def handle(self, *args, **options):
try:
if not Global.objects.all():
Global().save()
except Excepti... | null | bot/management/commands/setup.py | setup.py | py | 439 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "globalvars.models.Global.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "globalvars.models.Global.objects",
"line_number": 13,
"usage_... |
398770982 | """Socials URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | null | Socials/Socials/urls.py | urls.py | py | 2,071 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django... |
575617254 | from django.shortcuts import render, redirect, reverse
from django.views.generic import TemplateView, FormView
from django.contrib.auth import login, authenticate
from backtester.forms import *
import calendar
import time
import json
from .models import UserPortfolio, PortfolioTransactionHistory, PortfolioConditions, P... | null | backtester/views.py | views.py | py | 38,790 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.views.generic.FormView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 57,
"usage_type": "call"
},
... |
612826674 | import requests, random
import time
def ans1():
return ('{}({}{}{}) {}{}{}-{}{}-{}{}'.format(8,
9,random.randrange(0,9),random.randrange(0,9),
random.randrange(0,9),random.randrange(0,9),random.randrange(0,9),
random.randrange(0,9),random.randrange(0,9),
random.randrange(0,9),random.randrange(0,9)))
#ans1 = '8(9... | null | main.py | main.py | py | 2,092 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randrange",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.randrange",
... |
118402678 | import io
import json
import zipfile
import click
import requests
from skimage.io import imread, imsave
def download(input_dir, url):
print("Downloading data ...")
r = requests.get(url)
z = zipfile.ZipFile(io.BytesIO(r.content))
z.extractall(input_dir)
def load_tiff_stack(path):
stack = imread(... | null | examples/get_iss_data.py | get_iss_data.py | py | 2,905 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line... |
404985883 | """ base class """
import sys
import transaction
from zope.interface import directlyProvides
from pyramid import testing
from pyramid.interfaces import IRequest
from pyramid.interfaces import IRouteRequest
from pyramid.interfaces import IRequestExtensions
from pyramid.view import render_view_to_response
from pyramid.pa... | null | ptah/testing.py | testing.py | py | 4,650 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pyramid.interfaces.IRequest",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "pyramid.testing.DummyRequest",
"line_number": 49,
"usage_type": "call"
},
{
"api_na... |
473758997 | # DESCRIPTION OF THE CLASS:
# PROVIDE EXAMPLE:
import pyfftw as ft
import numpy as np
from mpi4py import MPI
class FourierOperations:
# Constructor: Default values to variables can also be assigned under constructor
def __init__(self,nx,ny,nz,nproc,my_id):
self.nx=nx
self.ny=ny
self.... | null | mpifft3d-kun/FourierOperations.py | FourierOperations.py | py | 5,644 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.fft.fftfreq",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"li... |
54022368 | from bs4 import BeautifulSoup, Tag
import unittest
import requests
import re
#########
## Instr note: the outline comments will stay as suggestions, otherwise it's too difficult.
## Of course, it could be structured in an easier/neater way, and if a student decides to commit to that, that is OK.
## NOTE OF ADVICE:
##... | null | si507f17_project3_code.py | si507f17_project3_code.py | py | 11,495 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
572271525 | import cPickle as pickle
import json
from itertools import groupby
from operator import itemgetter
from multiprocessing import Pool
from collections import defaultdict
from simstring.feature_extractor.character_ngram import CharacterNgramFeatureExtractor
from simstring.measure.cosine import CosineMeasure
from simstring... | null | tools/pdtools/searcher.py | searcher.py | py | 2,320 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cPickle.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cPickle.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cPickle.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "simstring.database.dict.DictDa... |
417667117 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import selenium
impor... | null | video.py | video.py | py | 7,326 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fake_useragent.UserAgent",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 33,
"usage_type": "call"
... |
653172454 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F #233
import torch.optim as optim
from torchvision import datasets,models,transforms
from PIL import Image
import sys
sys.path.append("..")
from attack import pgd
from netmodels.CNNmodel import Net
model = Net()
print("Load orignial ... | null | deeprobust/image/defense/test_PGD_defense.py | test_PGD_defense.py | py | 1,352 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "netmodels.CNNmodel.Net",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.load",
... |
395036969 | # uncompyle6 version 3.7.4
# Python bytecode 3.5 (3351)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /home/arroyo/ovp/suzano-ovp/django-ovp-organizations/ovp_organizations/migrations/0013_auto_20170111_1633.py
# Compiled at: 2017-02-22 17:56:49
# Size of source m... | null | pycfiles/ovp-organizations-1.0.13.tar/0013_auto_20170111_1633.cpython-35.py | 0013_auto_20170111_1633.cpython-35.py | py | 2,717 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterModelOptions",
"line_number": 17,
"usage_type": "call"... |
251134007 | """
Load an image and convert it into a numpy array for processing.
Author: Friedrich Schotte
Date created: 4 Sep 2013
Date last modified: Nov 1, 2017
"""
__version__ = "1.9.6" # conditional debug
DEBUG = False
from logging import debug,warn,info,error
import numpy
class numimage(numpy.ndarray):
"""An image rep... | null | numimage.py | numimage.py | py | 12,661 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.ndarray",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"... |
462929912 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 9/18/20 6:04 PM
# @Author : joshon
# @Site : hsae
# @File : xml_test.py
# @Software: PyCharm
#use the DOM4j to parse the
import xml.etree.ElementTree as ET
tree=ET.parse("../data/voc2012_raw/VOCdevkit/VOC2012/Annotations/2007_000032.xml")
root=tree.get... | null | test_for_joshon/xml_test.py | xml_test.py | py | 2,252 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 54,
"usage_type": "argument"
},
{
"api_n... |
72276438 | import inspect
import sys
import pandas as pd
import scipy.stats as ss
import numpy as np
import datetime as dt
from scipy.stats import spearmanr, kendalltau
import CrazyCod.Utilities.filters3 as filt
def np_nice_options(linelen=250, numpres=4):
np.set_printoptions(linewidth=linelen, precision=numpres)
def print... | null | CrazyCod/Utilities/pkgstdy.py | pkgstdy.py | py | 12,583 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "inspect.isclass",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "inspect.ismodule",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "inspect.isfun... |
248299686 |
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
x = [[6],[8],[10],[14],[18]]
y = [[7],[9],[13],[17.5],[18]]
regr = linear_model.LinearRegression()
regr.fit(x, y)
print('slope: ', regr.coef_)
print('intercept: ', regr.intercept_)
X2 = [[0], [10], [14], [25]]
plt.scatt... | null | sklearn/pizza-test.py | pizza-test.py | py | 536 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 18,
"usage_type": "call"
},
{
... |
308201410 | import torch
import numpy as np
import torchvision
import os
import argparse
parser = argparse.ArgumentParser()
arg_lists = []
def add_argument_group(name):
arg = parser.add_argument_group(name)
arg_lists.append(arg)
return arg
conv_arg = add_argument_group('conv args')
conv_arg.add_argument('--width', type... | null | model/conv_model.py | conv_model.py | py | 2,117 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "model.cain",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "model.cain.CAIN",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "model.cain",
"l... |
46714473 | import unittest
from unittest.mock import MagicMock
import requests
import conjur
from conjur import Client
from conjur.logic.policy_logic import PolicyLogic
from conjur.controller.policy_controller import PolicyController
class PolicyControllerTest(unittest.TestCase):
def test_policy_syntax_error_raises_unproc... | null | test/test_unit_policy_controller.py | test_unit_policy_controller.py | py | 1,324 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "conjur.Client",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "conjur.l... |
397708215 | import re
from .utils import trim, var_re
class Collection:
def __init__(self, name, base_url, all, add_folders):
self.name = name
self.base_url = base_url
self.all = all
self.add_folders = add_folders
self.endpoints = []
self.folders = []
@classmethod
de... | null | flask2postman/postman_v2.py | postman_v2.py | py | 3,358 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.trim",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "utils.var_re",
"line_number": 107,
"usage_type": "argument"
}
] |
55290328 | from queue import PriorityQueue
import numpy as np
np.seterr(all="raise")
import matplotlib.pyplot as plt
plt.style.use("ggplot")
import igraph
import networkx as nx
import shuo
from shuo.basics import get_list, UnionFind, PriorityQueueEntry
#############################################################
## Minimize ... | null | shuo/optimization.py | optimization.py | py | 18,402 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.seterr",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "ma... |
97823308 | import requests
from bs4 import BeautifulSoup
import pandas as pd
# This program prints Florida weather foreCast from a static page
# Code was adapted from "https://www.dataquest.io/blog/web-scraping-tutorial-python/"
# Get Florida weather page
page = requests.get("http://forecast.weather.gov/MapClick.php?l... | null | weatherFlorida.py | weatherFlorida.py | py | 1,536 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 26,
"usage_type": "call"
}
] |
238868521 | import unittest
from typing import List
class Trie(object):
def __init__(self, isWord=False):
self.children = [None] * 26
self.isWord = isWord
class Solution(unittest.TestCase):
def longestWord(self, words: List[str]) -> str:
"""
Given a list of strings words representing an English Di... | null | src/main/python/longest_word_in_dictionary.py | longest_word_in_dictionary.py | py | 3,014 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 57,
"usage_type": "name"
}
] |
289098316 | import re
import io
import time
import base64
import numpy as np
from PIL import Image
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from GetFont import GetFont_
"""
获取... | null | 第八章验证码识别/12306点击验证码/PartOfVerfication/VerificationCode.py | VerificationCode.py | py | 3,753 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 20,
"usage_type": "call"
},
... |
278261536 | from typing import Any, Dict
from datetime import datetime
from time import sleep
import json
import uuid
import logging
import sys
sys.path.append('..')
from queue_configuration.rabbitmq_example import HOST, PORT, USER, PASS, QUEUE
from logs import get_logger
import pika
import pika.channel
import pika.e... | null | epicbox_test/server/handler.py | handler.py | py | 3,889 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "queue_configuration.rabbitmq_example.HOST",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": ... |
511164797 | # coding: utf-8
from __future__ import unicode_literals
from django import forms
from photo.models import Photo
class PhotoEditForm(forms.ModelForm):
class Meta:
model = Photo
fields = ('image_file', 'description', )
# exclude = ('filtered_image_file',)
## add 04_22
class SearchForm(... | null | photo/forms.py | forms.py | py | 1,284 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "photo.models.Photo",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.fo... |
562787609 | import numpy as np
import ipdb as pdb
import copy
from numba import jit, prange
from collections import OrderedDict
from robust_boosting import exp_loss_robust, coord_descent_exp_loss, bisect_coord_descent, calc_h, \
basic_case_two_intervals, dtype
from utils import minimum, get_contiguous_indices
from stump_ensemb... | null | tree_ensemble.py | tree_ensemble.py | py | 22,137 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 90,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"... |
64985884 | #!/usr/bin/env python
# This is a part of the blackbox intended to perform a system test on the
# rcs communication.
import sysv_ipc
import time
# Mem size in bytes
KEY_SIZE = 1
DATA_SIZE = 20
p1_key = 0xAAA1
p2_key = 0xA2
p3_key = 0xA3
# Create p1, its purpose is to store keys of 1byte in size
p1_mem = sysv_ipc.S... | null | blackbox_com/bbox_powerlink_driver.py | bbox_powerlink_driver.py | py | 1,667 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sysv_ipc.SharedMemory",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sysv_ipc.IPC_CREX",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sysv_ipc.SharedMemory",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sy... |
546588563 | # ========================================================================
#
# Imports
#
# ========================================================================
import argparse
import os
import numpy as np
import scipy.spatial.qhull as qhull
import pandas as pd
from mpi4py import MPI
import stk
from scipy.interpolat... | null | channel_flow/post_processing/pp_channel_coarse.py | pp_channel_coarse.py | py | 8,637 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scipy.spatial.qhull.Delaunay",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.qhull",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "numpy.take",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.tak... |
284598133 | # coding: utf-8
import logging
import importlib
from enum import Enum
from datetime import datetime
from urllib.parse import urlencode, quote_plus
from authlib.jose import jwt
from sqlalchemy.sql.expression import and_
from helpdesk.libs.decorators import cached_property
from helpdesk.libs.sentry import report
from ... | null | helpdesk/models/db/ticket.py | ticket.py | py | 9,566 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "helpdesk.models.db.Model",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "helpdesk.mo... |
169916039 | # -*- coding: utf-8 -*-
from kivy.app import App
from kivy.lang import Builder
from kivy.config import Config
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.clock import Clock
from datetime import datetime
import substring
import Setting
# python import
import sys
import os.path
... | null | AddRework.py | AddRework.py | py | 4,681 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.path",
... |
144732638 |
import csv
import collections
import json
import os
import pickle
import shutil
import time
import luigi
import requests
from joakim import image_utils
# "perceptual image hashing, with a luigi twist.
class BaseImageTask(luigi.Task):
def task_name(self):
return str(self.__class__.__name__)
def d... | null | python/image_pipeline.py | image_pipeline.py | py | 7,091 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "luigi.Task",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "luigi.LocalTarget",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_num... |
317828912 | import pygame, sys, random
from pygame.locals import *
BOARDWIDTH = 15
BOARDHEIGHT = 10
TILESIZE = 40
WINDOWWIDTH = 750
WINDOWHEIGHT = 480
FPS = 30
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0 ,0)
GREEN = (0, 204, 0)
BLUE = (0, 0, 255)
BRIGHTBLUE = (0, 50, 255)
DARKTURQUOISE = (3, 54, 73)
BGCOLOR = BLACK
T... | null | final.py | final.py | py | 14,253 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.image.load",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
361427213 | # uncompyle6 version 3.6.7
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: /home/vincent/Projects/PythonPowerMole/powermolelib/powermolelib/miscellaneous.py
# Compiled at: 2020-05-13 13:45:25
# Size of source mod... | null | pycfiles/powermolelib-0.2.0-py3.7/miscellaneous.cpython-37.py | miscellaneous.cpython-37.py | py | 10,178 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "voluptuous.Schema",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "voluptuous.Re... |
496358115 | #!/usr/bin/python
# -*- coding:utf-8 -*-
# 生成TensorFlow pb模型文件供Java工程使用
from bert4keras.models import build_transformer_model
import tensorflow as tf
from keras import backend as K
from tensorflow.python.framework import graph_util, graph_io
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
def export_graph(model... | null | freeze_TFmodel.py | freeze_TFmodel.py | py | 1,878 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.gfile.Exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.gfile",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "tensorf... |
581636779 | '''
@judge UVa
@id 1644
@name Prime Gap
@tag Prime
'''
from sys import stdin
from itertools import takewhile, count
def isp(n):
return all(map(lambda x: n % x != 0, takewhile(lambda x: x * x <= n, count(2))))
def solve(k):
if isp(k):
return 0
a = max(takewhile(lambda x: k - x > 0 and isp(k - x) == False, co... | null | since2020/UVa/UVa 1644-prime.py | UVa 1644-prime.py | py | 472 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.takewhile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.takewhile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "itertools.cou... |
604858025 | # -*- coding: utf-8 -*-
#
#
# Author: alex
# Created Time: 2020年01月13日 星期一 10时45分29秒
import numpy as np
from dnn.text import detect_box
from helper.detectors import TextDetector
def solve(box):
"""
绕 cx,cy点 w,h 旋转 angle 的坐标
x = cx-w/2
y = cy-h/2
x1-cx = -w/2*cos(angle) +h/2*sin(angle)
y1 -cy= ... | null | server/utils.py | utils.py | py | 2,779 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.arcsin",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 45,
... |
223131505 | import os
import time
import argparse
import concurrent.futures
#Keep track of when the script began
startTime = time.time()
char = '\n' + ('*' * 70) + '\n'
# Argparse Information
parser = argparse.ArgumentParser(description="Uses a GEMINI database as input to identify CH variants. If a \
--fam_file' is not used, fal... | null | scripts/identify_CH_variants.py | identify_CH_variants.py | py | 16,612 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
150102395 | from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from settings.update_json import *
from imgn.media_json import *
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
# Create your views here.
check_index = -1
def movie(... | null | actvision/movie/views.py | views.py | py | 5,526 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.csrf.csrf_exempt",
"line_number": 49,
"usage_type": "name"
},
... |
552075319 | import sys
from neuron import h, gui
#from matplotlib import pyplot
h.load_file('stdrun.hoc')
h.load_file("rinzelnrn.hoc")
def test_direct_memory_transfer():
#h('''create soma''')
cell=h.rinzelnrn()
#h.psection()
#dir(h)
#h.soma.L=5.6419
#h.soma.diam=5.6419
#h.soma.insert("rinzelnrn")
... | null | test_direct.py | test_direct.py | py | 2,508 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "neuron.h.load_file",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "neuron.h",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "neuron.h.load_file",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "neuron.h",
"line_numb... |
313092386 | # @Time : 2019/5/27 18:46
# @Author : Xu Huipeng
# @Blog : https://brycexxx.github.io/
from typing import List
class Solution:
def plusOne(self, digits: List[int]) -> List[int]:
if not digits: return [1]
res = [0] * (len(digits) + 1)
carry, num = divmod(digits[-1] + 1, 10)
... | null | plusOne.py | plusOne.py | py | 659 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
}
] |
132830900 | #import csv
import sqlite3
import cplex
import pandas as pd
import numpy as np
# def asdf(a1,a2,a3):
# airpot = a1
# asdf = a2
# asdfff = a3
# summ = airpot + asdf + asdfff
# return summ
class TSP:
def __init__(self, nbairports):
self.nbairports = nbairports
self.conn = sq... | null | basic/tsp.py | tsp.py | py | 11,970 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "cplex.SparsePair",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "cplex.SparsePair",
"... |
251002590 | """ Parts of the U-Net model """
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import device
from torchsummaryX import summary
class depthwise_separable_conv(nn.Module):
def __init__(self, nin, nout,kernel_size=3,padding=1,stride=1,bias=True,dilation=1,):
super(depthwise_s... | null | models_v16_6.py | models_v16_6.py | py | 9,489 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
523371951 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 14 01:36:59 2018
@author: hujin
"""
from flask import Flask, render_template, request, jsonify
from bookmg import *
app = Flask(__name__)
class nav:
def __init__(self, href, text):
self.href = href
self.text = text
nav = [nav('/category/booksofpr','编程类... | null | web/app.py | app.py | py | 3,934 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask.reques... |
380097420 | import torch
import torch.nn as nn
import torch.optim as optim
from models import LSTMModel
from dataset import StockDataset
device = 'cuda' if torch.cuda.is_available() else 'cpu'
input_dim = 5
hidden_dim = 50
layer_dim = 1
output_dim = 3
num_epochs = 10
dset = StockDataset("./data")
train_loader = torch.utils.d... | null | train.py | train.py | py | 1,003 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "dataset.StockDataset",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.util... |
245044857 | import calendar, csv, StringIO
import xml.etree.ElementTree as ET
from tempfile import TemporaryFile
from django.db import models
from django.template.loader import render_to_string
from django.core.mail import EmailMultiAlternatives, send_mail, EmailMessage
from events.models import Event, EventPerson, EventMaterial... | null | htdocs/emails/models.py | models.py | py | 14,537 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 21,
"usage_type": "call"
},
{
"api_name... |
188442114 | # Python version 3.5
# -*- coding:utf8 -*-
# Author:busyboy
import datetime as dt
import os, uuid
from django.conf import settings
def upload_generation_dir(dir_mame):
today = dt.datetime.today()
dir_mame = dir_mame + '/%d/%d/' % (today.year,today.month)
# print(dir_mame)
# print(settings.ME... | null | blog_project/admin/uploads.py | uploads.py | py | 1,187 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",... |
511132502 | '''
Created on Oct 31, 2011
@author: syarc
'''
from cheuvreux.bluebox.pta.report import DB
from cheuvreux.dbtools.odbc import ODBC
from cheuvreux.stdio.mail import HtmlEmail
from cheuvreux.utils.dataset import Dollar, Percentage, Quantity, Dataset, \
to_html, Integer, ComposedValue
from datetime import date
impor... | null | usr/sivla/cheuvreux/bluebox/pta/report/latency.py | latency.py | py | 2,472 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cheuvreux.fidessa.fidessadb.getODBCConnection",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cheuvreux.fidessa.fidessadb",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 43,
"usage_type": "call"
... |
593373959 | from setuptools import setup,find_packages
config = {
'description':'git deployment tools',
'version':'0.0.1',
'name':'deployer',
'package_dir': {'':'lib'},
'packages': ['deployer'],
'entry_points': {
'console_scripts':[
'prereceiver=deployer.prereceiver:main'
]
}
}
setup(**config)
| null | setup.py | setup.py | py | 314 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 16,
"usage_type": "call"
}
] |
362245504 | import sys
from types import SimpleNamespace
from .polarize import polarize
from .initialize import initialize
from .qm.qm import QM
from .qm.qm_base import HessianOutput
from .forcefield import ForceField
from .molecule import Molecule
from .fragment import fragment
from .dihedral_scan import DihedralScan
from .frequ... | null | qforce/main.py | main.py | py | 5,311 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "misc.print_phase_header",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "misc.PHASES",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "initialize.initialize",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "misc.add_jo... |
279898440 | import requests
import time
import json
from os.path import dirname, abspath
class Transaction(object):
def __init__(self):
self.custom_timers = {}
self.post_body = {'tree1_nwk':"(((((Glycine_max_ott681762,Carica_papaya_ott429474),Vitis_vinifera_ott756728),(Solanum_tuberosum_ott494835,Lact... | null | QoS/ws_27/test_scripts/regular_user.py | regular_user.py | py | 1,265 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 17,... |
461487496 | import random
import itertools
import datas
class Participant():
newID = itertools.count().__next__
def __init__(self, name):
self.name = name
self.id = Participant.newID()
self.email = ''
self.giftee = ''
self.gifter = ''
self.blacklist = []
def __repr__(s... | null | secretsanta.py | secretsanta.py | py | 2,989 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.count",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "datas.participants",
"line_number": 94,
"usage_type": "attribute"
},
{
"api_name": "datas.constrain... |
220608397 | import argparse
import logging
from stevedore import ExtensionManager
def entrypoint(args=None):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='command')
subparsers.required = True
commands = {}
def register_extension(ext, commands=commands):
try:
... | null | bonobo/commands/__init__.py | __init__.py | py | 715 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.exception",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "stevedore.ExtensionManager",
"line_number": 22,
"usage_type": "call"
}
] |
458167570 | import errno
import os
import shutil
import unicodedata
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import colorama
import pathspec
from jinja2 import FileSystemLoader
from jinja2.sandbox import SandboxedEnvironment
from packaging import version
from pydantic import StrictBool
from yam... | null | copier/tools.py | tools.py | py | 5,649 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "colorama.init",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "types.IntSeq",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "colorama.Fore",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "colorama.Style",
"l... |
318741037 | import json
import os
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.runtime.client_request import ClientRequest
from office365.runtime.utilities.request_options import RequestOptions
class SharepointApi:
"""
Attempt using user credentials auth
"""
def... | null | sharepoint/sharepoint_wrapper/sharepoint_api2.py | sharepoint_api2.py | py | 1,578 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "office365.runtime.auth.authentication_context.AuthenticationContext",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribu... |
626936370 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import HttpResponse
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from rest_framework import generics
from django.shortcuts import render,... | null | clean/views.py | views.py | py | 4,378 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "models.Garbages.objects.all",
"line_number": 22,
"usage_type": "call"
... |
589689873 | import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="ticks")
df = sns.load_dataset("iris")
print(type(df))
df.describe()
print(df)
sns.pairplot(df, hue="species")
plt.show() | null | scatterplot_matrix.py | scatterplot_matrix.py | py | 191 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.set",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "seaborn.load_dataset",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "seaborn.pairplot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.sho... |
71226922 | from selenium import webdriver
import time
login = input("Введите логин: ")
passwd = input("Введите пароль: ")
target_group = "https://www.instagram.com/smkventilyatcia/"
all = 500
browser = webdriver.Chrome(r"/home/viktor_/PycharmProjects/MyProjects/instabot/chromedriver")
browser.get("https://www.instagram.com/")
... | null | instabot/createpersonslist.py | createpersonslist.py | py | 3,059 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
599088332 | '''
########################################################################
# Misc Utilities
# by Vishang Shah (vishangshah.com)
# IMPORTANT : This tool is tested and works only with Houdini 14.
#
# Description : Miscellaneous Utilities to help with Houdini and Houdini Engine workflows.
#
1. Add a Switch to selected ... | null | Python/HOUtilities/MiscUtilities.py | MiscUtilities.py | py | 2,587 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.partial",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "hou.selectedNodes",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "hou.node",
"line_number": 78,
"usage_type": "call"
}
] |
571150424 | import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
sys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages')
import numpy as np
#import matplotlib.pyplot as plt
# min_HSV = np.array([0, 230, 230], dtype = "uint8")
# max_HSV = np.array([20, 255, 255], dtype = "uint8")
# # Get po... | null | imageProcessing/armour_bound.py | armour_bound.py | py | 2,848 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.remove",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
124942778 | from pandas import read_excel
import matplotlib.pyplot as plt
from statsmodels.tsa.seasonal import seasonal_decompose
k226_df_all = read_excel('K226data_31404626.xls', shee_tname='data', header=0,
index_col=0, squeeze=True, parse_dates=True)
result = seasonal_decompose(k226_df_all)
k226_df = k226_df_a... | null | ExponentialSmoothing/ExponentialSmoothing_K2262013Plot_31404626.py | ExponentialSmoothing_K2262013Plot_31404626.py | py | 563 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_excel",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "statsmodels.tsa.seasonal.seasonal_decompose",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 14,
"usage_type": "call"
},
{
... |
323554019 | import numpy as np
import pandas as pd
from ray import tune
from copy import deepcopy
# from hyperopt import hp
from typing import Any, Callable, Dict
from ray.tune.suggest.optuna import OptunaSearch
from sklearn.model_selection import cross_val_score
"""
This python script uses the ray library to automate hyperparame... | null | titanic/ray_hyper_opti_1.py | ray_hyper_opti_1.py | py | 4,987 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "feature_processing_3.load_and_process_data_set",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ray.tune.suggest.optuna.OptunaSearch",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "ray.tune.run",
"line_number": 45,
"usage_type": "call... |
141332861 | # Copyright 2017 AT&T Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | null | patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py | test_server_actions_rbac.py | py | 15,794 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tempest.config.CONF",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "tempest.config",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "oslo_log.log.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "oslo_l... |
648952465 | import numpy as np
import wheelpy.muc as muc
import matplotlib.pyplot as plt
# import tclab
# import time
from scipy.integrate import solve_ivp, odeint
from scipy.optimize import minimize
import pickle
un = muc.uReg
un.setup_matplotlib()
proj_dir = "./data/"
HP0 = 100
NPts = 6000
time = np.arange(NPts+... | null | trends_gen.py | trends_gen.py | py | 3,668 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wheelpy.muc.uReg",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "wheelpy.muc",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"lin... |
522870104 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope t... | null | scripts/lib/wic/plugins/source/filescopy.py | filescopy.py | py | 5,037 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "wic.pluginbase.SourcePlugin",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "wic.WicError",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "wic.misc.e... |
631929606 | #!/cluster/apps/python/3.2.2/x86_64/bin/python
import logging
import subprocess
from SimulationRunner import SimulationRunner
from get_arguments import get_folder
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
def main():
args = get_folder()
sr = SimulationRunner(... | null | code/simulation_archive.py | simulation_archive.py | py | 471 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "get_argument... |
649514685 | import string
import yaml
from mock import patch
from test import HokusaiUnitTestCase
from test.utils import captured_output
from hokusai.lib.common import print_green, print_red, set_verbosity, verbose, returncode, shout, k8s_uuid, build_deployment, build_service
TEST_MESSAGE = 'Ohai!'
class TestCommon(HokusaiUni... | null | test/unit/test_common.py | test_common.py | py | 5,618 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "test.HokusaiUnitTestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "test.utils.captured_output",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "hokusai.lib.common.print_green",
"line_number": 16,
"usage_type": "call"
},
{
... |
592327610 | import os, time, glob
from youtube_title_parse import get_artist_title
try:
import pafy # type: ignore
except:
print("Install 'pafy' library using 'pip install pafy'")
try:
from pytube import Playlist
except:
print("Install 'pytube' library using 'pip install pytube'")
try:
from .common import comm... | null | modules/ytDownloader.py | ytDownloader.py | py | 4,926 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytube.Playlist",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "common.common",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": ... |
116538767 | # Authors: Soledad Galli <solegalli@protonmail.com>
# License: BSD 3 clause
from typing import List, Union
import pandas as pd
from feature_engine.docstrings import (
Substitution,
_feature_names_in_docstring,
_fit_transform_docstring,
_inverse_transform_docstring,
_n_features_in_docstring,
_... | null | feature_engine/encoding/mean_encoding.py | mean_encoding.py | py | 4,506 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "feature_engine.encoding.base_encoder.BaseCategorical",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 113,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 113,
"usage_type": "name"
},
{
"a... |
71858984 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | null | CMS/Zope-3.2.1/Dependencies/zope.app-Zope-3.2.1/zope.app/form/browser/tests/test_objectwidget.py | test_objectwidget.py | py | 4,194 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "zope.interface.Interface",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "zope.schema.TextLine",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "zope.schema.TextLine",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "zo... |
547726549 | import copy
from collections import OrderedDict
from django.utils.formats import date_format
from django.utils.translation import ugettext_lazy as _
from pytz import timezone
from pretix.base.signals import layout_text_variables
from pretix.base.templatetags.money import money_filter
DEFAULT_VARIABLES = OrderedDict(... | null | src/pretix/base/pdf.py | pdf.py | py | 6,155 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.OrderedDict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 18,
"usage_type": ... |
265853328 | import sqlite3
from sqlite3 import Error
def create_connection(db_file):
connection = None
try:
connection = sqlite3.connect(db_file)
print(sqlite3.version)
except Error as e:
print("Error:create_database: " + str(e))
return connection
def create_table(connection, sql_create_ta... | null | ahof.py | ahof.py | py | 5,953 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlite3.version",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.Error",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlite3.Error",
"... |
641620872 | #! /usr/bin/python3
#! scatter_plot_writing_data_to_file
#######################################? scatter plot
#* scatter plot is a diagram where each value in the data set is represented by a dot
#* we can draw scatter plot using scatter(x, y) method
import matplotlib.pyplot as plt
x = [5,7,8,7,2,17,2,9,4,11,12,9... | null | Machine Learning/scatter_plot_writing_data_to_file.py | scatter_plot_writing_data_to_file.py | py | 1,203 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ma... |
493735878 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
def surface_plot(X,Y,Z,**kwargs):
""" WRITE DOCUMENTATION
"""
xlabel, ylabel, zlabel, title = kwargs.get('xlabel',""), kwargs.get('ylabel',""), kwargs.get('zlabel',""), kwargs.get('title',""... | null | robot_synthetize/bin/plot_error.py | plot_error.py | py | 4,144 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mat... |
99004335 | from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
from Environment import Easy21
from scipy.sparse import diags
def policy_epsilon_greedy(N0, dealer, player_sum, action_value, number_action_value):
"""Pick action epsilon-greedily"""
action_value_ij = action_va... | null | utils.py | utils.py | py | 11,769 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.binomial",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.argmax",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.argmin",
... |
177115738 | __author__ = 'Jeeva'
import boto3
import json
import datetime
from boto3.session import Session
from flask import Flask,jsonify,request
from netaddr import IPNetwork, IPAddress
from urllib.request import urlopen
app = Flask(__name__)
accounts = ['prod','dev','legacy']
accounts = ['prod']
regions = ['us-west-2','us-we... | null | aws/whatsthisip/whatsthisip_old.py | whatsthisip_old.py | py | 5,356 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.JSONEncoder",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "netaddr.IPAd... |
331246813 | from selenium import webdriver
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.fandango.com/11553_movietimes?mode=general&q=11553")
print(driver.title)
driver.quit()
"""
# Theater Name
# Path = "/html/body/main/div/section[2]/div[1]/div[7]/ul/li[1]/div[1]/div... | null | movieTimes.py | movieTimes.py | py | 358 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
}
] |
200283066 | # import standard libs
import numpy as np
import gym
import random
import pickle
from matplotlib import pyplot as plt
from tqdm import *
random.seed(42)
np.random.seed(42)
# hyperparameters
# learning rate
ALPHA = 0.03
ALPHA = [ .1, .08, .05, .03, .01 ]
STICK_ACTION = 0
# exploration
EPSILON = 0.1
EPSILON=[ .9, .7... | null | blackjack_16.py | blackjack_16.py | py | 3,583 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"li... |
586858575 |
__author__ = 'Kamilion@gmail.com'
########################################################################################################################
## Imports
########################################################################################################################
# Local site config imports
fro... | null | app/mailer.py | mailer.py | py | 3,057 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "smtplib.SMTP",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "app.config.SMTP",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "app.config.SMTP",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "smtplib.SMTPException",
... |
163445391 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 11 11:53:42 2016
@author: Jesse; Jason
"""
import numpy as np
import matplotlib.pyplot as plt
import Tkinter as tk
from copy import deepcopy
import calcium_imaging_data_fast as cidfast
import open_calcium_data_fast as ocdfast
root = tk.Tk()
root.update... | null | analyze_calcium_fast_2.py | analyze_calcium_fast_2.py | py | 5,583 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Tkinter.Tk",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "open_calcium_data_fast.openData",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "copy.deepcop... |
308757596 | import bs #Created By MythB # http://github.com/MythB
import bsInternal
import os
chatfile = '/root/bs/chat/ChatMessages.html'
#Use your own file location here
class RSSchat(object):
def collector(self,nick,msg):
#get account id from nick
"""for i in bsInternal._getForegr... | null | Utils/MythBChatMessages.py | MythBChatMessages.py | py | 1,694 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
348242885 | # -*- coding: utf-8 -*-
#
# MIT License
#
# Copyright (c) 2017-2018, Leo Moll
#
# 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
# ... | null | addon.py | addon.py | py | 13,433 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "resources.lib.kodi.KodiAddon.KodiPlugin",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "resources.lib.settings.Settings",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "resources.lib.notifier.Notifier",
"line_number": 63,
"usage_type"... |
24628012 | import copy
import csv
import json
import os
import re
import time
from pathlib import Path
# noinspection PyProtectedMember
from urllib.parse import urljoin
from bs4 import Comment
import bs4 as bs4
import requests
from selenium import webdriver
from selenium.common.exceptions import TimeoutException,... | null | UOSydney/UOSydney_Data.py | UOSydney_Data.py | py | 50,415 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 4... |
634603539 | from functools import reduce
def if3(cond, a, b):
if cond:
return a
else:
return b
def ff(t1, t2):
(err1, ok1) = t1
(err2, ok2) = t2
return (if3(err1 !='', err1+"<br>", err1)+err2, ok1 and ok2)
alist = [("name", "Employee Name"), ("dep", "Departement"), ("job", "Job Title"), ("salar... | null | final_submission/test_server/cgi-bin/pscript2.py | pscript2.py | py | 1,039 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.reduce",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cgi.FieldStorage",
"line_number": 23,
"usage_type": "call"
}
] |
357976238 | #!/usr/bin/python
# encoding: utf-8
import os
import ConfigParser
from screen_prints import *
from logme import *
from errHandling import *
from reserved_words import *
import argparse
def get_args():
"""TODO."""
parser = argparse.ArgumentParser(
description='Restauración de DB Historica')
parse... | null | libs/configs.py | configs.py | py | 3,848 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
251091905 | from flask import Flask, render_template, request, redirect, url_for
from pymongo import MongoClient
from bson.objectid import ObjectId
import os
from datetime import datetime
host = os.environ.get('MONGODB_URI', 'mongodb://localhost:27017/Webstore')
client = MongoClient(host=f'{host}?retryWrites=false')
db = client.... | null | app.py | app.py | py | 3,278 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.