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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
257593598 | import http.client as httplib
import json
class HyperTrackException(Exception):
def __init__(self, status=None, title=None, detail=None, type=None, instance=None, code=None, **kwargs):
"""
Problem exception
:param status: The HTTP status code generated by the origin server for this occurre... | null | hypertrack/exceptions.py | exceptions.py | py | 3,070 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "http.client.responses",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "http.client.responses",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "htt... |
618707690 | from django.shortcuts import render
from .models import food
# Create your views here.
def index(request):
food_list = []
food1=food()
food1.img='01.jpg'
food1.title='Vegetable salad'
food1.desc='Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very good'
food1.price='$6'
... | null | shop/views.py | views.py | py | 2,175 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.food",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.food",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.food",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.food",
"line_number": 2... |
38683057 | import os
import signal
import logging
import subprocess
logger = logging.getLogger(__name__)
def record(recording):
logger.info("Starting to record {}".format(recording.programme.title))
ffmpeg = subprocess.Popen("/bin/ffmpeg -i {}?{} -acodec copy -vcodec copy "
"-threads 1 -f m... | null | iptv_recorder/recorder/tasks/record.py | record.py | py | 850 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "subprocess.DEVNULL",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "subprocess.... |
543146845 | # tutorial00
# ファイルの中の単語の頻度を数えるプログラムを作成
from collections import defaultdict
DEBUG = True
# ディクショナリの初期値を0に設定
d = defaultdict(lambda: 0)
# デバッグモードの場合は短文を入力にする
input_path = "../test/00-input.txt" \
if DEBUG else "../data/wiki-en-train.word"
with open(input_path) as f:
# 1行ずつ
for s_line in f:
# 文を単語に... | null | hirao/tutorial00/tutorial00.py | tutorial00.py | py | 649 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
}
] |
291699822 | import argparse
import csv
import logging
from typing import Iterator, List, TextIO
from django.core.management.base import BaseCommand
from django.db.models.expressions import RawSQL
from tqdm import tqdm
from geo import errors
from geo.models import Tract
from hmda.models import LARYear, LoanApplicationRecord
from ... | null | hmda/management/commands/load_hmda.py | load_hmda.py | py | 4,461 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.TextIO",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tqdm.tqdm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_numb... |
586903256 | from mimesis import Person
import random
prsons = {}
for i in range(10):
person = Person('pl').full_name()
prsons[person] = []
user_nums=[]
for i in range(6):
user_nums.append(random.randint(1, 10))
prsons[person].extend(list(set(user_nums)))
for human, number in prsons.items():
pr... | null | Lesson_7/Homework/fav_numbers.py | fav_numbers.py | py | 385 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mimesis.Person",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 11,
"usage_type": "call"
}
] |
616352146 | from flask import Flask,request, abort
from services import root_dir, nice_json
from werkzeug.exceptions import NotFound
import json
from bson import json_util
import pymongo
client = pymongo.MongoClient('0.0.0.0:27017')
cinema_db = client['cinema_db']
ticket_collection = cinema_db['ticket']
app = Flask(__name__)
... | null | services/ticket.py | ticket.py | py | 961 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bson.json_util.dumps",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "bson.json_util",
... |
58140416 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import matplotlib.pyplot as plt
import pandas as pd
__author__ = 'LH Liu'
def get_data_hist_distribution(data, col=None):
if col is not None and isinstance(data, pd.DataFrame):
plot_data = data[col]
else:
p... | null | recommenda_by_rules/utils/plot_distribution_for_selected_result.py | plot_distribution_for_selected_result.py | py | 635 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplo... |
160199397 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gc
import math
import os
import numpy as np
import tensorflow as tf
from sklearn.utils import shuffle
def load_data(path):
reps_path = os.path.join(path, "reps.csv")
labels_path = os.path.join... | null | nn.py | nn.py | py | 3,451 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
534966487 | import cPickle; import pymodel.model as model; import pyutils.utils as utils; import numpy as np
import cPickle; data_test = cPickle.load(open("/bignickssd/akolesnikov/datasets/binary/horseSeg-test.dump"))
import cPickle; data = cPickle.load(open("/bignickssd/akolesnikov/datasets/binary/horseSeg-small2.dump"))
import s... | null | scripts/exps/exp1.py | exp1.py | py | 1,735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cPickle.load",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "cPickle.load",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pyutils.utils.load_dict_hdf5",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyutils.utils",
... |
49077465 | import streamlit as st
from PIL import Image
def upload_image():
uploaded_image = st.file_uploader("Please choose an image file", type=["png", "jpg", "jpeg"])
if uploaded_image is not None:
try:
image = Image.open(uploaded_image)
except Exception: # Check invalid image
... | null | src/image_upload.py | image_upload.py | py | 1,035 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "streamlit.file_uploader",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "streamlit.error",
"... |
560791426 | from distutils.util import strtobool
from django.http.response import JsonResponse
from django.core.exceptions import ValidationError
from rest_framework import status, viewsets
from rest_framework.decorators import list_route
from django.http import JsonResponse
from estudio.models import Estudio
from turno.models imp... | null | stats/views.py | views.py | py | 9,919 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.viewsets.GenericViewSet",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "estudio.models.Estudio",
"line_number": 24,
"usage_type": "name"
},... |
368076018 | # Given two words (beginWord and endWord), and a dictionary's word list,
# find all shortest transformation sequence(s) from beginWord to endWord, such that:
# Only one letter can be changed at a time.
# Each transformed word must exist in the word list.
# Note:
# Return 0 if there is no such transformation seq... | null | 12 BFS + DFS/126. Word Ladder II.py | 126. Word Ladder II.py | py | 3,486 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "string.ascii_lowercase",
"line_number": 40,
"usage_type": "attribute"
}
] |
451157021 | """Config flow to configure the honeywell integration."""
from __future__ import annotations
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback
from . import get_somecomfort_client
from .const import (... | null | homeassistant/components/honeywell/config_flow.py | config_flow.py | py | 3,031 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "homeassistant.config_entries.ConfigFlow",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "homeassistant.config_entries",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "const.DOMAIN",
"line_number": 20,
"usage_type": "name"
},
{... |
382039919 | import time
import logging
log_filename = "hello.log"
class InputOutput:
def __init__(self, filename: str):
self.filename = filename
if filename != "":
self.flag_log = True
self.info("INFO : Logging activate")
logging.basicConfig(filename=self.filename, level=l... | null | projects/tests-logs.py | tests-logs.py | py | 1,221 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "time.localtime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.error",... |
611998229 | import os
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
class GraphWindowConfidenceNotZero:
def __init__(self, path, prefix, prediction, is_dt, encode_paths):
self.prefix = prefix
self.prediction = prediction
self.is_dt = is_dt
self.enc... | null | sources/metric/graph_window_confidence_not_zero.py | graph_window_confidence_not_zero.py | py | 2,052 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
395099605 | from io import open
import glob
import numpy as np
import math
import os
import xlrd
from sklearn import preprocessing
import matplotlib.pyplot as plt
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
from scipy.optimize import curve_fit
#写入文件
def WriteFile(arr, filePath):
np.savetxt(filePath, arr,... | null | 2020_CUMCM/MCM2020/A/mcmutil.py | mcmutil.py | py | 11,661 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.savetxt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_... |
290184341 | #!/usr/bin/env python3
#
# Indicator app to show the current status
# of the Duply backup script
#
# Matthias Homann
# 03.02.2018
import signal
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
gi.require_version('Notify', '0.7')
from gi.repository import Gtk, AppIndicator3, GObject... | null | backup/backup_indicator.py | backup_indicator.py | py | 7,450 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gi.require_version",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gi.require_version",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "gi.require_version",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gi.repositor... |
299375184 | from Products.CMFPlone.interfaces import INonInstallable \
as IPloneFactoryNonInstallable
from Products.CMFQuickInstallerTool.interfaces import INonInstallable \
as IQuickInstallerNonInstallable
from zope.interface import implements
class HiddenProfiles(object):
implements(IQuickInstallerNonInstallable, I... | null | buildout-cache--/eggs/plone.app.collection-1.1.3-py2.7.egg/plone/app/collection/integration.py | integration.py | py | 840 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zope.interface.implements",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Products.CMFQuickInstallerTool.interfaces.INonInstallable",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "Products.CMFPlone.interfaces.INonInstallable",
"line_nu... |
488285668 | from setuptools import setup, find_packages
import sys, os
version = '1.0.2'
# Set common test dependencies
test_dependencies = [
'mock',
'nose',
]
if sys.version_info < (2, 7):
test_dependencies.append('argparse')
test_dependencies.append('unittest2')
# Note: The package maintainer needs pypandoc a... | null | setup.py | setup.py | py | 1,675 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.version_info",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pypandoc.convert",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 25,
"usage_type": "call"
}
] |
89486549 | #%% template
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 18 11:32:11 2019
@author: ibahadiraltun
"""
import collections
import pandas as pd
import numpy as np
import pickle
import glob
import sys
import os
DIR_PATH = os.getcwd()
PATH = '/Users/ibahadiraltun/Desktop/CLEF-2019-CheckThat/CLEF2... | null | CLEF2019_Task1/data/submissions/solution_cont1/train_test.py | train_test.py | py | 3,347 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_n... |
95765432 | import requests
from bs4 import BeautifulSoup
URL = 'http://localhost:8090/HELLOWEB2/hello.jsp'
response = requests.get(URL)
html = response.text
soup = BeautifulSoup(html, 'html.parser')
all_tds = soup.find_all("td")
j = 0
for i in all_tds :
print(i.string)
j+=1
if(j == 3) :
print()
j ... | null | HELLOPYTHON/day06/mybs01.py | mybs01.py | py | 324 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
}
] |
437696505 | from pydub import AudioSegment
song = AudioSegment.from_wav('REC032.wav')
def trans_to_mp3():
tags = {
'artist': '李胜',
'album': 'EECS',
}
song.export('20180114 图形学 06.mp3', format='mp3', bitrate='192k', tags=tags, cover='example.jpg')
def main():
trans_to_mp3()
if __name__ == '__... | null | main.py | main.py | py | 350 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pydub.AudioSegment.from_wav",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment",
"line_number": 4,
"usage_type": "name"
}
] |
559590701 | import bs4
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import requests
import re
def get_webpage(url):
"""Henter URL ned som tekst"""
r = requests.get(url)
r.raise_for_status()
return r.text
def find_top_five(html_txt):
"""1. Brug web scr... | null | Uge7/exercise07.py | exercise07.py | py | 3,371 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "selenium.we... |
275631149 | import webapp2
import cgi
from google.appengine.api import users
from google.appengine.ext import db
import jinja2
import os
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
MAIN_PAGE_HTML = """\
<html>
<body>
<form action="/sign" method="post">
<div>... | null | searchbar.py | searchbar.py | py | 2,352 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jinja2.Environment",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
280381687 | # -*- coding: utf-8 -*-
import pymysql
import requests
import time
db = pymysql.Connect(
host='192.168.139.140',
port=3306,
user='root',
passwd='123456',
db='test',
charset='utf8'
)
# 使用cursor()方法获取操作游标
cursor = db.cursor()
# SQL 语句
sql = 'select url from apt_blacklist_url'
cursor.execute(sq... | null | urltest.py | urltest.py | py | 576 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymysql.Connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 27,
"usage_type": "call"
}
] |
335883989 | from abc import abstractmethod
from enum import Enum
import pandas as pd
from functions import MathFunctions as mf
from functions import TrigonometricFunctions as trf
import abstract.select_data as data
#Prueba para dataframe:
df = data.dataSelect()
df.crossJoin()
class TYPE(Enum):
NUMBER = 1
STRING = 2
... | null | parser/team29/analizer/abstract/expression.py | expression.py | py | 18,597 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "abstract.select_data.dataSelect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "abstract.select_data",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "enum.E... |
137103650 | import sqlite3
from sqlite3 import OperationalError
import datetime as dt
import pandas as pd
class Dbquery(object):
""" Query given database """
def __init__(self, dbname):
self.dbname = dbname
self.con = sqlite3.connect('thieves/data/' + self.dbname + '.db')
def db_exist(self)... | null | dbquery.py | dbquery.py | py | 4,840 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlite3.OperationalError",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pandas.read_sql",
"line_number": 140,
"usage_type": "call"
}
] |
165666115 | """
Over-the-air services using MIFARE DESFire EV1 protocol
This implementation is based on the following publicly available sources:
* Mifare Desfire communication example
https://ridrix.wordpress.com/2009/09/19/mifare-desfire-communication-example/
* Desfire EV1 Communication Examples from sotechcllc/RFDoorLock
... | null | server.py | server.py | py | 13,160 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "virtual_card.VirtualCard",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
644627829 | import copy
import django_filters
from datetime import datetime
from rest_framework import mixins, viewsets, filters, views
from rest_framework.response import Response
from django.core.paginator import Paginator
from django.db.models import Q, Prefetch, Sum
from django.contrib.contenttypes.models import ContentType
fr... | null | simplegit/zerocar-master/shop/rest/apis.py | apis.py | py | 5,924 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django_filters.FilterSet",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "django_filters.DateFilter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django_filters.DateFilter",
"line_number": 21,
"usage_type": "call"
},
{
... |
250223306 | import numpy as np
import pandas as pd
from collections import defaultdict
import itertools
from typing import List, Dict
class FatFingerError(Exception):
pass
class EmptyLOB(Exception):
pass
class BrokerAccount(object):
"""
Class represents a portfolio of instruments
Each trader has a book (i... | null | sim/exchange.py | exchange.py | py | 13,785 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number": 163,
"usage_type": "attribute"
},
{
"api_name": "numpy.uint8",
"line_number": 163,
"usage_type": "attribute"
},
{
"api_name": "pandas.Da... |
38510941 | # -*- coding: utf -8 -*-
#=============导入模块===============
import pygame,sys,random,traceback,os
from pygame.locals import *
#=============所有常量==============
screenwidth = 480
screenheight = 700
bg_size = screenwidth, screenheight
color_black = (0,0,0)
color_red = (255,0,0)
color_green = (0,255,0)
color_white = (255,2... | null | fjdz.py | fjdz.py | py | 34,395 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.sprite",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "p... |
96619746 | import sqlite3
import sys
import struct
import time
import pickle
import random
import math
import gc
import matplotlib.pyplot as plt
import numpy as np
import numpy as np
import pandas as pd
from pandas.plotting import scatter_matrix
if len(sys.argv) != 4 :
print("Error with command line inputs")
sys.exit(0)... | null | learning/attributeDefine/createData.py | createData.py | py | 7,535 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 21... |
60119111 | from flask import request
from api import socketio
from databaseRep import add, get, set
from next_id import get_next_id
@socketio.on('joinRoom')
def joined_room(data):
print('<{} joined room>'.format(data.get('username')))
current_user_dict = {}
current_user_dict['sid'] = request.sid
current_user... | null | api/sockets.py | sockets.py | py | 1,092 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.request.sid",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "next_id.get_next_id",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "databaseRep.... |
235424208 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 01 11:05:46 2019
@author: Neal
"""
import requests
from bs4 import BeautifulSoup
import pandas as pd
fake_header = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",
... | null | week3/html_crawler.py | html_crawler.py | py | 1,927 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 45,
"usage_type": "call"
}
] |
397765657 | # -*- coding: utf-8 -*-
# @Time : 19-5-22
# @Author : hay
from django.forms import ModelForm
class BaseModelForm(ModelForm):
class Meta:
model = None
exclude = ()
fields = '__all__'
def validator_field(self, field_name, value):
model_fields = self.get_model_local_fields()
... | null | core/base/basemodelform.py | basemodelform.py | py | 977 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "name"
}
] |
71819097 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defines UiAutomatorSuiteRunner which is used to run uiAutomator test types.
UiAutomator tests consist of an apk and a jar file. The jar file contains tes... | null | src/build/util/test/uiautomator_suite_runner.py | uiautomator_suite_runner.py | py | 4,992 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "src.build.util.test.suite_runner.SuiteRunnerBase",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "src.build.util.test.suite_runner",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_number": 51,
"usage_type"... |
476214707 | import xml.etree.ElementTree as ET
import re
import pandas as pd
import operator
import glob
import os
from utils import save_obj
class CorefPreprocess():
def __init__(self, config):
cols = ['text_id', 'paragraph', 'sentence', 'word', 'POS', 'ne_id', 'nphead', 'mod']
self.df = pd.DataFrame(co... | null | preprocess.py | preprocess.py | py | 13,484 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
347828735 | '''
$Author: murco $
$Id: JROHeaderIO.py 151 2012-10-31 19:00:51Z murco $
'''
import sys
import numpy
import copy
import datetime
import inspect
from schainpy.utils import log
SPEED_OF_LIGHT = 299792458
SPEED_OF_LIGHT = 3e8
BASIC_STRUCTURE = numpy.dtype([
('nSize', '<u4'),
('nVersion', '<u2'... | null | schainpy/model/data/jroheaderIO.py | jroheaderIO.py | py | 29,135 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.dtype",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.dtype",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.dtype",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.dtype",
"line_number": ... |
159122603 | from __future__ import absolute_import
from celery import Celery
from datetime import timedelta
from django.conf import settings
app = Celery('auctweb',
broker='redis://localhost',
backend='redis://localhost',
include=['auctweb.apps.aserver.tasks'])
app.config_from_object('dj... | null | auctweb/celery.py | celery.py | py | 700 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "celery.Celery",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.INSTALLED_APPS",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 15,
"usage_type": "name"
},
{
"api_na... |
633281138 | from plotly.graph_objs import Bar, Layout
from plotly import offline
from die import Die
# Create the two d8 dices
die_1 = Die(8)
die_2 = Die(8)
results = []
frequencies = []
# Trying a big number
number_of_rolls = 500000
min_sides_value = 2
max_sides_value = die_1.sides + die_2.sides
# Loop through the rolls
for ... | null | Data visualization/Chapter 1/plotply/d8_visualization.py | d8_visualization.py | py | 1,092 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "die.Die",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "die.Die",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Bar",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Layout",
"l... |
155388587 | import os
import pygame
pygame.init()
os.environ['SDL_VIDEO_WINDOW_POS'] = '0,0'
window = pygame.display.set_mode((0,0),pygame.NOFRAME)
rnbsqr = pygame.image.load("rnbsqr.png").convert_alpha()
pos = [32,32]
spd = 4
cont = True
while cont:
window.fill(0)
window.blit(rnbsqr, pos)
pygame.display.fl... | null | Tle/Informatique/Tests/bouger.py | bouger.py | py | 917 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
... |
307000079 |
from evm.utils.hexadecimal import (
encode_hex,
)
from evm.vm.forks.homestead.vm_state import (
HomesteadVMState,
)
from .blocks import SpuriousDragonBlock
from .computation import SpuriousDragonComputation
from .utils import collect_touched_accounts
class SpuriousDragonVMState(HomesteadVMState):
block_... | null | evm/vm/forks/spurious_dragon/vm_state.py | vm_state.py | py | 1,085 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "evm.vm.forks.homestead.vm_state.HomesteadVMState",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "blocks.SpuriousDragonBlock",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "computation.SpuriousDragonComputation",
"line_number": 16,
"u... |
428293800 | from openpyxl import load_workbook
import sys
import pickle
def save_obj(obj, name):
with open('userdb/'+ name + '.pkl', 'wb') as f:
pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL)
def load_obj(name):
with open('userdb/' + name + '.pkl', 'rb') as f:
return pickle.load(f)
update = input("Would yo... | null | UserProfile.py | UserProfile.py | py | 1,523 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.dump",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_work... |
23158474 | import gym
import pickle
import time
import os
from Q_learning import Q_learning
current_dir = os.path.dirname(os.path.realpath(__file__))
env = gym.make('MountainCar-v0')
with open(os.path.join(current_dir, 'Q_table.pkl'), 'rb') as file:
Model = pickle.load(file)
state = env.reset()
done = False
step = 0
while not... | null | QLearning/test_Qtable.py | test_Qtable.py | py | 582 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gym.make",
"line_numbe... |
233245059 | import webapp2
from handlers.base import BaseHandler
from helpers import is_debug
class ExampleHandler(BaseHandler):
def get(self):
self.render_response('example.html')
routes = [
webapp2.Route('/', handler=ExampleHandler, name='example'),
]
app = webapp2.WSGIApplication(routes, config={}, debug=is_d... | null | example/handlers/example.py | example.py | py | 328 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "handlers.base.BaseHandler",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "webapp2.Route",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "webapp2.WSGIApplication",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "helper... |
446284931 | from django.shortcuts import render
from dealer.dealers.models import Dealer
def list_dealers_view(request):
dealers = Dealer.objects.all().prefetch_related('user')
return render(
request,
'dealers/list.html',
{'dealers': dealers}
)
def detail_dealer_view(request, dealer_pk):
... | null | scr/dealer/dealers/views.py | views.py | py | 544 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dealer.dealers.models.Dealer.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dealer.dealers.models.Dealer.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "dealer.dealers.models.Dealer",
"line_number": 7,
"usage_... |
70895674 | from affine import Affine
import numpy as np, os
from geoproc.util.configuration import ConfigurableObject, Region
from geoproc.util.crs import CRS
from typing import Dict, List, Tuple
from osgeo import osr, gdalconst, gdal
from pyproj import Proj, transform
from geoproc.data.grid import GDALGrid
from shapely.geometry ... | null | geoproc/xext/xgeo.py | xgeo.py | py | 9,715 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "geoproc.xext.xextension.XExtension",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "xarray.DataArray",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "geoproc.xext.xextension.XExtension.__init__",
"line_number": 21,
"usage_type": "... |
347207122 | from sklearn.linear_model import LogisticRegression
import numpy as np
class LogisticCalibration(LogisticRegression):
def decision_function(self, X, y=None):
scores = super(LogisticRegression, self).decision_function(X)
scores *= -1
np.exp(scores, scores)
scores += 1
np.rec... | null | pymv/train/calibration.py | calibration.py | py | 374 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "numpy.exp",
"line_number": 9,
"usage_type": "call"
},... |
598781509 | from befh.api_socket import ApiSocket
from befh.util import Logger
import websocket
import threading
import json
import time
import zlib
class WebSocketApiClient(ApiSocket):
"""
Generic REST API call
"""
def __init__(self, id, received_data_compressed=False):
"""
Constructor
:pa... | null | befh/ws_api_socket.py | ws_api_socket.py | py | 4,533 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "befh.api_socket.ApiSocket",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "befh.api_socket.ApiSocket.__init__",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "befh.api_socket.ApiSocket",
"line_number": 18,
"usage_type": "name"
},
{
... |
405468952 | import json
from common.boto_utils import BotoUtils
from common.logger import get_logger
from dapp_user.config import DELETE_USER_WALLET_ARN, REGION_NAME
from dapp_user.domain.factory.user_factory import UserFactory
from dapp_user.infrastructure.repositories.user_repository import UserRepository
from dapp_user.constan... | null | dapp_user/domain/services/user_service.py | user_service.py | py | 2,913 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common.logger.get_logger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dapp_user.domain.factory.user_factory.UserFactory",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dapp_user.infrastructure.repositories.user_repository.UserRepository",... |
248414559 | import imutils
import cv2
import pytesseract
import numpy as np
custom_config = r'--oem 3 --psm 6'
img = cv2.imread("16.jpg")
img = imutils.resize(img, height=400)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# cv2.imshow('grayscale', gray)
# ret, thresh1 = cv2.threshold(gray, 0, 255, cv2.THRESH_OTSU | cv2.THRESH_BIN... | null | text-extraction.py | text-extraction.py | py | 3,758 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "imutils.resize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_nu... |
531910382 | from django.shortcuts import render
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
from django.http import Http404
from django.http import HttpResponse
# Create your views here.
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.v... | null | story/views/scene_views.py | scene_views.py | py | 5,898 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "story.models.Branch",
"line_number": 26,
"usage_type": "name"
},
{
"api_n... |
17222458 | from discord.ext import commands
import lib.database as db
options = ["default", "uwu", "confused", "pirate", "triggered", "italian", "fuck", "ironic", "patronise", "colonial", "safe", "biblical"]
class speak(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="speak")
... | null | cogs/speak.py | speak.py | py | 930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "lib.database.changemode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name... |
501265041 | # Bungeni Parliamentary Information System - http://www.bungeni.org/
# Copyright (C) 2010 - Africa i-Parliaments - http://www.parliaments.info/
# Licensed under GNU GPL v2 - http://www.gnu.org/licenses/gpl-2.0.txt
"""Support for UI Form Fields descriptions
$Id$
"""
log = __import__("logging").getLogger("bungeni.ui.de... | null | bungeni.main/branches/oauth/bungeni/ui/descriptor/field.py | field.py | py | 10,684 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bungeni.ui.descriptor.constraints.check_email",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "bungeni.ui.descriptor.constraints",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "bungeni.ui.descriptor.constraints.check_login",
"line_nu... |
84602242 | # coding: utf-8
from __future__ import absolute_import
from typing import List, Dict # noqa: F401
from rest_api.swagger_server.models.base_model_ import Model
from rest_api.swagger_server.models.point import Point # noqa: F401,E501
from rest_api.swagger_server import util
class Measurement(Model):
"""NOTE: T... | null | rest_api/swagger_server/models/measurement.py | measurement.py | py | 3,243 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_api.swagger_server.models.base_model_.Model",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "rest_api.swagger_server.models.point.Point",
"line_number": 18,
"usage_type"... |
504374369 | from collections import defaultdict
from itertools import combinations
from math import gcd, atan2
ex1 = """.#..#
.....
#####
....#
...##"""
ex2="""......#.#.
#..#.#....
..#######.
.#.#.###..
.#..#.....
..#....#.#
#..#....#.
.##.#..###
##...#..#.
.#....####"""
ex3="""#.#...#.#.
.###....#.
.#....#...
##.#.#.#.#
....#... | null | 2019/10.py | 10.py | py | 2,950 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.gcd",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "math.gcd",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
... |
124811560 | import csv #modulo csv
from matplotlib import pyplot as plt
from datetime import datetime
filename = 'death_valley_2014.csv' #ruta del archivo
with open(filename) as f:
reader = csv.reader(f) #Crea un objeto reader para abrir el archivo
header_row = next(reader) # devuelve una lista con la siguiente linea
... | null | ProjectII_Py/highs_lows.py | highs_lows.py | py | 1,560 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
486007775 | import browsercookie
import requests
import time
import json
class MyDetails:
@staticmethod
def get_details():
ts = int(time.time() * 1000)
ts_str = str(ts)
cookie_str = ""
url = "https://my.rmit.edu.au/service/mydetails?time=" + ts_str
fake_header = {
"... | null | myrmit/mydetails.py | mydetails.py | py | 1,353 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "browsercookie.chrome",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_nu... |
358468809 | import math
import matplotlib.pyplot as plt
import numpy as np
def main():
m = 5
g = 9.8
mu = 0.01
k = 2
dt = 0.001
x = 10
x_1p = 0
x_2p = None
first_5k = []
for i in range(0,3*60*1000):
first_5k.append(x)
if x_1p == 0:
x_2p = (-k/m)*x
else... | null | SimpleHarmonic.py | SimpleHarmonic.py | py | 524 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
... |
5453384 | import sqlite3
class DB:
conn = None
pathDB = None
cur = None
def __init__(self, pathDB) -> None:
if pathDB == None:
print('Path to SQLite cannot be Null')
else:
self.pathDB = pathDB
self.connect_db()
if self.conn == None:
... | null | #2_sqlite_save_data/repositories.py | repositories.py | py | 1,778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 20,
"usage_type": "call"
}
] |
252018301 | """
Created on August 26, 2019
@author: Yi Wang
"""
import datetime
import glob
import numpy as np
import os
import pandas as pd
import sys
from mylib.get_satellite_metadata import get_mxd04_metadata
from mylib.select_region import all_files_in_regions
sys.path.append('/Dedicated/jwang-data/ywang/project_global_CWA/... | null | select_region/code/main_select_file_global_region.py | main_select_file_global_region.py | py | 5,688 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cwa_parameters.region_dict",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "datetim... |
642007045 | """
Utilities for unit tests
"""
from datetime import datetime, timedelta
import time
from uuid import UUID
import xarray as xr
import dask.array as da
import numpy as np
from odc.stats.utils import CompressedDataset
from odc.stats.model import StatsPluginInterface
class DummyPlugin(StatsPluginInterface):
NAME = ... | null | libs/stats/tests/__init__.py | __init__.py | py | 3,026 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "odc.stats.model.StatsPluginInterface",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "xarray.Dataset",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "dask.a... |
572898545 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from logging import getLogger
_logger = getLogger(__name__)
CLOSE_REASONS = [
('find_another','Find Another'),
('not_interested','Warning'),
... | null | business_lending_application/wizard/business_close.py | business_close.py | py | 1,332 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "odoo.models.TransientModel",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "odoo.fie... |
414917924 | """
Scrapes animal data from LA County Animal Control website
"""
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_condition... | null | Web_Scraper.py | Web_Scraper.py | py | 5,985 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
599082712 | from collections import deque
class Solution(object):
def stringShift(self, s, shift):
"""
:type s: str
:type shift: List[List[int]]
:rtype: str
"""
s = deque([x for x in s])
for each in shift:
if each[0] == 0:
s.rotate(-1 * each[1... | null | week2/performstringshifts.py | performstringshifts.py | py | 401 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
120742035 | #! /usr/bin/env python3
import vcf
__author__ = 'Alexander Molin'
class Assignment2:
def __init__(self, file_name="chr22_new.vcf"):
self.filename = file_name
## Check if pyvcf is installed
print("PyVCF version: %s" % vcf.VERSION)
# Create reader object
self.total_num_var... | null | assignment2.py | assignment2.py | py | 4,496 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "vcf.VERSION",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "vcf.Reader",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "vcf.Reader",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "vcf.Reader",
"line_number"... |
509992406 | import logging, re
from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from website.lib.base import BaseController, Session, render
import database as db
log = logging.getLogger(__name__)
class SettingsController(BaseController):
def index(sel... | null | Website/website/controllers/settings.py | settings.py | py | 1,214 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "website.lib.base.BaseController",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pylons.tmpl_context.current",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
606967270 | from binance.client import Client
import pandas as pd
import numpy as np
import sys
import time
from datetime import datetime
import json
from sys import maxsize
from numpy import set_printoptions
from pymongo import MongoClient, DESCENDING, ASCENDING
from prettytable import PrettyTable
client = MongoClient('localhost... | null | Wallet.py | Wallet.py | py | 1,832 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "binance.client... |
154290552 | from flask import Flask, redirect, url_for, render_template, request, redirect, session, flash, Blueprint
from flask_sqlalchemy import SQLAlchemy
from model.Car import Car
from model.Booking import Booking
app = Flask(__name__)
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_DATABASE_URI'] ... | null | sphinx/scripts/Engineer.py | Engineer.py | py | 943 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "model.Car.Car.query.filter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mode... |
521832630 | import bpy
import os
from .path import normpath
DEFAULT_CHANNEL = 1
DEFAULT_BLEND_TYPE = 'REPLACE'
DEFAULT_LENGTH = 24
def is_available_sequences(scene):
if not scene.sequence_editor:
return False
sequences = scene.sequence_editor.sequences
if sequences:
return True
def enable_sequence_... | null | scripts/modules/vgblender/sequencer.py | sequencer.py | py | 5,035 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.basename",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 85,
"usage_type": "attribute"
},
{
"api_name": "path.normpath",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"l... |
87574149 | # coding=utf-8
from setuptools import setup, find_packages
def parse_requirements(filename='requirements.txt'):
""" load requirements from a pip requirements file. (replacing from pip.req import parse_requirements)"""
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter i... | null | setup.py | setup.py | py | 930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 17,
"usage_type": "call"
}
] |
303018073 | # -*- coding: utf-8 -*-
import re
from django import forms
from django.contrib.auth.models import Permission
from django.core.exceptions import ValidationError
from django.db.models import Q
from users.models import User
from domains.models import Domain, ActionLog
class DomainChangeForm(forms.ModelForm):
perm ... | null | apps/domains/forms.py | forms.py | py | 14,761 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.Permission.objects.filter",
"line_number": 14,
"usage_type": "call"
... |
553332001 | import sys
import statistics
file = open( sys.argv[1] , "r+" )
lines = file.read().rstrip("\n").split("\n")
file.seek(0)
for a in range( len(lines) ):
tokens = lines[a].rstrip("\t").split("\t")
for b in range( len(tokens) ):
try:
tokens[b] = int( tokens[b] )
except:
tokens[b] = float( tokens[b] )
mean ... | null | calc_mean_median.py | calc_mean_median.py | py | 962 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "statistics.mean",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "statistics.median",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
... |
630216783 | #!/usr/bin/python3
"""
Export data in the JSON format.
"""
import json
import requests
from sys import argv
if __name__ == '__main__':
urluser = 'https://jsonplaceholder.typicode.com/users/{}'.format(argv[1])
respuser = requests.get(urluser)
userdict = respuser.json()
resptask = requests.get('https://... | null | 0x15-api/2-export_to_JSON.py | 2-export_to_JSON.py | py | 839 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 15,
... |
477036755 | from django.urls import path
from django.contrib.auth import views
from . import views
urlpatterns = [
path('', views.record_page, name="record_page"),
path('create/', views.create_record, name="create_record"),
path('form/<str:pk>/', views.update_record, name="record_form"),
path('delete/<str:pk>/', ... | null | apps/records/urls.py | urls.py | py | 440 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.views.record_page",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.views",
"line_number": 7,
"usage_type": "name"
},
{
... |
433976085 | #!/usr/bin/env python3
# coding: utf-8
# File: chatbot_graph.py
# Author: lhy<lhy_in_blcu@126.com,https://huangyong.github.io>
# Date: 18-10-4
from question_classifier import *
from question_parser import *
from answer_search import *
import web
import json
'''问答类'''
class ChatBotGraph:
def __init__(self):
... | null | chatbot_graph.py | chatbot_graph.py | py | 1,629 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "web.data",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "web.application",
"line_number": 55,
"usage_type": "call"
}
] |
133704787 | import os
#import glob
from pydub import AudioSegment
import sys
import csv
from csv_indices_to_global_conditioning_names import INDICES_to_GC_NAME
import pickle
#### get passed in directory name
### go through each line of csv
### pass line to get_global_category_ids
### pass to save_as_wav
gc_id_utter_num = pickle.... | null | convert_gc.py | convert_gc.py | py | 2,139 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 1... |
111268124 | # Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
from asyncio import gather, iscoroutine, sleep, ensure_future
from dataclasses import dataclass
from typing import Dict, TYPE_CHECKING, Union, Optional
from .command_types import AppCo... | null | pincer/objects/app/interactions.py | interactions.py | py | 18,944 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "utils.APIObject",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "utils.APINullable",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
... |
648705269 | # %%
import pandas as pd
import overlap
import matplotlib.pyplot as plt
import contextily as cx
import shapely
from shapely.geometry import Polygon, mapping
# %%
def main():
pass
pkl = "grotsund_arp_12h-max.pkl"
df = pd.read_pickle(pkl)
m = df.max()
values = m.loc[("Deposition [Bq/m2]", 48, slice(None), '', 'Cs-137... | null | create_isocurve_map.py | create_isocurve_map.py | py | 2,078 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_pickle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "overlap.isocurve",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "overlap.GROTSUND_COORD",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "shape... |
351492286 | #!/usr/bin/python
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.svm import OneClassSVM
percent = "10"
hour = "Omicron_12h"
print("Inicio Test: SVM dataset con "+str(percent)+"% outliers")
df = pd.read_csv("... | null | Failure_Detection_Mechanism/Per_Hour/codes/test_SVM.py | test_SVM.py | py | 2,151 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": ... |
648753756 | import re
from collections import defaultdict
from itertools import product
data = open('Puzzle3_input.txt', 'r').read().split('\n')
measurements = (map(int, re.findall(r'-?\d+', line)) for line in data)
cloth_map = defaultdict(list)
overlap = defaultdict(list)
for claim_no, coord_x, coord_y, w, h in measurements:
... | null | Puzzle3.py | Puzzle3.py | py | 838 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.findall",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "itertools.pro... |
507324953 | # -*- coding:utf-8 -*-
from flask import Flask
import logging
from logging.handlers import TimedRotatingFileHandler
app = Flask(__name__)
@app.route('/')
def hello_world():
app.logger.info("Info message")
app.logger.warning("Warning msg")
app.logger.error("Error msg!!!")
return 'Hello, World!'
if _... | null | basic/main.py | main.py | py | 723 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.handlers.TimedRotatingFileHandler",
"line_number": 21,
"usage_type": "call"
}
] |
558418378 | from datetime import datetime
import logging
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from edx_rest_api_client.client import EdxRestApiClient
from requests import RequestException
from slumber.exceptions import HttpClie... | null | bridge_adaptivity/api/backends/openedx.py | openedx.py | py | 9,431 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "edx_rest_api_client.client.EdxRestApiClient",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.core.cache.cache.get",
"line_number": 34,
"usage_type": "call"
},
... |
137177525 | import django_filters
from django.db.models import Q
from django.forms import TextInput, fields
from auto.models import Product
SORT_CHOICES = {
('lowToHigh', 'Low to High'),
('highToLow', 'High to Low'),
('aToz', 'A To Z'),
('zToa', 'Z To A'),
}
CATEGORY_CHOICES = {
('Interior', 'INTERIOR'),
... | null | auto/filters.py | filters.py | py | 2,136 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django_filters.FilterSet",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "auto.models.Product",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "django.forms.fields",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": ... |
337083222 | import uuid
import datetime
class Message:
"""
Message class definitions to logging
"""
def __init__(self, message_body:str, mac_address:str, sensor_id:str, sensor_type:str, sensor_data_type:str, interval:int, msg_count:int):
self.message_id = uuid.uuid4().__str__()
self.device_id = ... | null | RaspberryPI/message.py | message.py | py | 1,424 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "uuid.uuid4",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
}
] |
417972960 | import sys
sys.path.append(r'../..')
from marketsim import (signal, strategy, trader, orderbook,
timeserie, scheduler, observable, veusz, mathutils)
const = mathutils.constant
from common import expose
@expose("Trade-If-Profitable", __name__)
def TradeIfProfitable(ctx):
ctx... | null | marketsim/samples/try_if_profitable.py | try_if_profitable.py | py | 2,475 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "marketsim.mathutils.constant",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "marketsi... |
405372834 | from django.core.cache import cache
from django.utils.timezone import now
import logging #使用日志
import datetime
# Create your views here.
logger = logging.getLogger('myapp.views')
# -*- coding: utf-8 -*-
import logging
from django.shortcuts import render, redirect, HttpResponse
from django.core.urlresolvers import reve... | null | myapp/views.py | views.py | py | 4,978 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.SITE_URL",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 27,
"usage_type": "name"
},
{
"api_name... |
51297708 | """
@File : config.py
@Author : Cao Zhijie
@Email :
@Date : 2020/5/26
@Desc :
"""
import os
import yaml
def parse_configs(config_file_path,train_or_test='train'):
with open(config_file_path) as f:
config_file = yaml.load(f)
if train_or_test=='train':
common_config = ... | null | src/config/config.py | config.py | py | 2,074 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "yaml.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number":... |
617899842 | import sys
from tqdm import tqdm
from glob import glob
from utils import Node, traverse_label, traverse
import numpy as np
import pickle
import os
import torch
from collections import Counter
import re
from os.path import abspath
import nltk
from transformers import *
import warnings
warnings.filterwarnings("ignore")
... | null | code/structure-preprocessing/preprocessing_AACC.py | preprocessing_AACC.py | py | 3,632 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.Node",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "utils.traverse_label"... |
46643716 | '''
Support custom Avro serializer for transferring data; this can improve performance.
'''
import avro.io
import avro.schema
import io
import logging
AVSC = '''
{
"namespace": "SHIELD.INGEST",
"type": "record",
"name": "list.avsc",
"fields": [
{
"name": "list",
"ty... | null | distributed/d_collector/serializer.py | serializer.py | py | 1,748 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "avro.io.io.BinaryDecoder",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "avro.io.io",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "avro.io",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "io.BytesIO",
"li... |
425175609 | from django.db import models
from django.utils import timezone
from enum import Enum
from mptt.models import MPTTModel, TreeForeignKey
from django.contrib.auth.signals import user_logged_in
from django.urls import reverse
from decouple import config
import random
from django.conf import settings
from django.utils.trans... | null | ideax/models.py | models.py | py | 9,043 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.models.Group.objects.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.Group.objects",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.Group",
"line_number": ... |
237962853 | import os
from PIL import Image
import urllib3
from pyzbar.pyzbar import decode
import pygoqrme
from twilio.rest import Client
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
from os.path import basename
imp... | null | qr.py | qr.py | py | 6,201 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "twilio.rest.Client",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
111085274 | import base64
import colander
from sqlalchemy import (
Column,
Date,
Index,
String,
PrimaryKeyConstraint,
)
from sqlalchemy.dialects.mysql import (
INTEGER as Integer,
TINYINT as TinyInteger,
)
from sqlalchemy.ext.declarative import declared_attr
from ichnaea.constants import (
PERMANE... | null | ichnaea/models/wifi.py | wifi.py | py | 8,467 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base64.b64decode",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "base64.b16encode",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "base64.b16decode",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",... |
348162576 | from django import forms
from wagtail.core import blocks
from wagtail.images.blocks import ImageChooserBlock
from wagtail.contrib.table_block.blocks import TableBlock
#Walidacja problemu
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
class TitleBlock(blocks.StructBlock):
... | null | .history/streams/blocks_20201029155448.py | blocks_20201029155448.py | py | 4,303 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wagtail.core.blocks.StructBlock",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wagtail.core.blocks",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "wagtail.core.blocks.CharBlock",
"line_number": 11,
"usage_type": "call"
},
{... |
515906264 | #!/usr/bin/env python
'''
Lucas-Kanade tracker
====================
Lucas-Kanade sparse optical flow demo. Uses goodFeaturesToTrack
for track initialization and back-tracking for match verification
between frames.
Usage
-----
lk_track.py [<video_source>]
Keys
----
ESC - exit
'''
import numpy as np
import cv2
import pic... | null | trajectory.py | trajectory.py | py | 4,310 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.TERM_CRITERIA_EPS",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITERIA_COUNT",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 33,
"usage_type": "call"
},
{
"api_name... |
648433037 | import os
from json import loads
import yaml
import zmq
from transitions import Machine
from transitions import State
from ..utils import error
from ..utils import listify
from ..utils import load_module
class PanStateMachine(Machine):
""" A finite state machine for PANOPTES.
The state machine guides th... | null | pocs/state/machine.py | machine.py | py | 11,851 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "transitions.Machine",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.getenv",
"line_number": 192,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 198,
"usage_type": "call"
},
{
"api_name": "utils.error.InvalidConfig",... |
266084868 | # Generic modularized configuration file manager.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: July 13, 2017
# URL: https://pypi.python.org/pypi/update-dotdee
"""The Python API of the update-dotdee program."""
# Standard library modules.
import hashlib
import logging
import os
# External dependenc... | null | update_dotdee/__init__.py | __init__.py | py | 6,379 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "property_manager.PropertyManager",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.pa... |
114130934 | import datetime
import math
import smtplib
def is_prime(n):
if n==1: return False
for k in range(2, int(math.sqrt(n)+1)):
if n%k==0:
return False
return True
##SMTPサーバに接続する
smtp_obj = smtplib.SMTP('smtp.gmail.com', 587)
type(smtp_obj)
smtp_obj.ehlo()
smtp_obj.starttls()
smtp_obj.... | null | src/utl/SMTP.py | SMTP.py | py | 705 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"... |
229098730 | from . import MetadataRenderer
import mistune
def checkExist(txt):
if txt is not None:
return txt
return 'post'
class Post:
markdown = mistune.Markdown()
def readFile(self, filename):
with open(filename, 'r') as f:
output = f.read()
f.close()
self.r... | null | penguin/post.py | post.py | py | 906 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mistune.Markdown",
"line_number": 12,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.