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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
471586827 | """Finding the best hyperparameters for CNN"""
# Imports
import tensorflow as tf
from tensorflow.python.keras import Sequential
from tensorflow.python.keras.layers import Conv2D
from tensorflow.python.keras.layers import MaxPooling2D
from tensorflow.python.keras.layers import Flatten
from tensorflow.python.keras.layer... | null | project/tuning_cnn.py | tuning_cnn.py | py | 4,861 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.python.keras.Sequential",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.keras.layers.Conv2D",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.keras.layers.MaxPooling2D",
"line_number": 24,
... |
463278874 | import random
import matplotlib.pyplot as plt
import numpy as np
import backpropagation as bp
random.seed(0)
y = lambda x: 0.3 + 0.2 * np.cos(2 * np.pi * x)
def prob_4_17():
"""Use a two-layer perceptron with a linear output unit to approximate the function
y(x) = 0.3 + 0.2cos(2πx), x∈[0, 1]
To thi... | null | neural_network/main40.py | main40.py | py | 1,831 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": ... |
455829563 | import numpy as np
import os
from vapory.vapory import Camera, LightSource, Texture, Pigment, Scene, Box, Finish
from vapory.io import render_povstring
import multiprocessing
def gen_dirs(dirname):
for i in range(10):
class_dir = os.path.join(r'data',dirname,str(i))
if not os.path.exists(class_di... | null | 3d_rendering/render.py | render.py | py | 2,608 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
612249437 | """
Manipulate XML for nanoHUB tools
Benjamin P. Haley, Purdue University (bhaley@purdue.edu)
Copyright 2017 HUBzero Foundation, LLC.
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 rest... | null | nanoHUB_remote/hubxml.py | hubxml.py | py | 4,814 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.dumps",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "api.launch_tool",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "api.get_results",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
... |
11130487 | import redis
import argparse
from collections import defaultdict
import json
# Install dependencies hiredis, redis
import math
import json
import numpy as np
from scipy import spatial
parser = argparse.ArgumentParser()
parser.add_argument("-b","--binaryfile")
args = parser.parse_args()
emb = dict()
# Load the entity... | null | scripts/viz/generate_biggraph_tsne.py | generate_biggraph_tsne.py | py | 1,425 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"lin... |
313663607 | from django.conf.urls import url
from django.contrib import admin
from . import views
app_name = 'logos'
urlpatterns = [
#/
url(r'^$', views.home_view ,name ="home_view"),
#/search/text/
url(r'^search/<text>[a-z]+/$', views.search_view ,name = "search_view"),
#/logos/
url(r'^logos/$', vi... | null | logos/urls.py | urls.py | py | 595 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.... |
46472003 | import os, sys
sys.path.append(os.path.dirname(__file__))
from pathlib import Path
import numpy as np
from pyspark.sql import SparkSession
from pyspark.sql.types import DoubleType, IntegerType
from const import Gaussian_loc, Gaussian_scale, Poisson_iam, DistriType
np.random.seed(1)
class COL:
def __init__(se... | null | Task2/task2/step1_create_df.py | step1_create_df.py | py | 2,698 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
482353821 | from typing import Any, Callable, List, Optional, Tuple, Union
import torch
from torch import Tensor
from torchaudio._internal import (
module_utils as _mod_utils,
misc_ops as _misc_ops,
)
from torchaudio.utils.sox_utils import list_effects
if _mod_utils.is_module_available('torchaudio._torchaudio'):
fr... | null | torchaudio/sox_effects/sox_effects.py | sox_effects.py | py | 18,662 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torchaudio._internal.module_utils.is_module_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torchaudio._internal.module_utils",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.ops.torchaudio.sox_effects_initialize_sox_effects",... |
579129198 | import cv2
# reading images
img = cv2.imread('Photos/Sanji.jpg')
cv2.imshow('Ori', img)
scale = 0.5
width = int(img.shape[1] * scale)
height = int(img.shape[0] * scale)
dimensions = (width, height)
img0 = cv2.resize(img, (width, height))
cv2.imshow('Resized', img0)
lined = cv2.line(img0, (0, 0), (250,... | null | Week4 Challenge 1.1.py | Week4 Challenge 1.1.py | py | 839 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 13,
... |
431732824 | from PyQt5 import QtCore, QtWidgets, QtGui
from apiAccountDatabase import Database
class AddAccountGroup(QtWidgets.QDialog):
def __init__(self, names, parent=None):
QtWidgets.QWidget.__init__(self, parent)
self.setupUi(self)
self.name = ""
self.accountGroupEntryInterval = ""
... | null | guiAddAccountGroup.py | guiAddAccountGroup.py | py | 6,388 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget.__init__",
"line_number": 8,
"usage_type": "call"
},
{
"api_na... |
418004556 | #!/usr/bin/env python
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
import csv
import os
import json
languages = [
'english',
'spanish',
'french',
'chinese-mandarin',
'italian',
'arabic',
'russian',
'portuguese',
'korean',
'japanese',
'thai',
'german',
'h... | null | submit_urls.py | submit_urls.py | py | 1,604 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 35,
"usage_... |
374368139 | import pyodbc
conn = pyodbc.connect('Driver={SQL Server};'
'Server=tcp:labsql1860.database.windows.net,1433;'
'Database=labsql-test;'
'Uid=yying;Pwd=Yull18601234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;')
cursor = conn.cursor()
curs... | null | helloworld/sqltest.py | sqltest.py | py | 396 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyodbc.connect",
"line_number": 2,
"usage_type": "call"
}
] |
80121117 | __author__ = "Brett Copeland"
__copyright__ = "Copyright 2021, Brett Copeland"
__email__ = "brcopeland@ucsd.edu"
__license__ = "MIT"
from snakemake.shell import shell
from snakemake_wrapper_utils.java import get_java_opts
extra = snakemake.params.get("extra", "")
java_opts = get_java_opts(snakemake)
log = snakemake.... | null | bio/picard/collectgcbiasmetrics/wrapper.py | wrapper.py | py | 655 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "snakemake.shell.params.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "snakemake.shell.params",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "snakemake.shell",
"line_number": 10,
"usage_type": "name"
},
{
"api_name":... |
640934599 | #!/usr/bin/python -u
import sys
import time
import datetime
import atexit
blueLED = open('/dev/talos/led/blue','w', 0)
greenLED = open('/dev/talos/led/green','w', 0)
redLED = open('/dev/talos/led/red', 'w', 0)
yellowLED = open('/dev/talos/led/yellow', 'w', 0)
leftFront = open('/dev/talos/motorF/speed', 'w', 0)
leftB... | null | tele.py | tele.py | py | 3,525 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "date... |
141571117 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^search$', views.search, name="search"),
url(r'^test', views.test, name="test"),
url(r'^$', views.index, name='login'),
url(r'^sign_up', views.sign_up, name='sign_up'),
url(r'^new_releases', views.new_releases, name='new_releases'),
u... | null | app1/urls.py | urls.py | py | 1,857 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
650276935 | import datetime
import pytz
from django.urls import reverse
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.core import mail
from circles.models import Event, MailTemplate
User = get_user_model()
class EventListTestCase(TestCase):
ur... | null | circles/tests/test_views.py | test_views.py | py | 4,267 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
467363771 | import json
import csv
import pandas as pd
def open_json(path):
with open(path) as file:
hashmap = json.load(file)
return hashmap
crime_data = pd.read_csv("Data/CrimeData.csv")
general_data = pd.read_csv("Data/All_Intersections.csv")
crime_list = open_json("JSON/CrimeTypesData.json")
crime_dates = op... | null | Python/merge_crime_data.py | merge_crime_data.py | py | 1,662 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number... |
394464039 | # coding: utf-8
from django.contrib.auth.models import AnonymousUser
from django.core.urlresolvers import reverse
from django.http.response import HttpResponseRedirect
def get_orders_from_request(request):
"""Return all the Orders created from the provided request."""
from shop.models import LazyOrder
ord... | null | shop/util/order.py | order.py | py | 2,112 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.models.AnonymousUser",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "shop.models.LazyOrder",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "shop.models.LazyOrder",
"line_number": 21,
"usage_type": "call"
},
... |
275266936 | # Tong Zhao, tzhao2@nd.edu
# Paul Fortin, pfortin@nd.edu
import os
import sys
import glob
import json
import codecs
import plot.got3 as got
import numpy as np
import preprocessor as pp
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.metrics import adjusted_rand_score
from ... | null | website_s/plot/_product_sentiment_analysis.py | _product_sentiment_analysis.py | py | 7,220 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.date.today",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "plot.got3.manager.Twe... |
576689502 | import logging
import json
from datetime import datetime
from django.conf import settings
from django.core.cache import cache
from canvas_sdk.utils import get_all_list_data
from canvas_sdk.methods import courses as canvas_api_courses
from icommons_common.canvas_utils import SessionInactivityExpirationRC
from icommo... | null | bulk_site_creation/utils.py | utils.py | py | 5,510 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "icommons_common.canvas_utils.SessionInactivityExpirationRC",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.CANVAS_SDK_SETTINGS",
"line_number": 21,
... |
631954868 | #Jaden-Gen: The ultimate Jaden simulator.
from TwitterAPI import TwitterAPI
import sys
import random
import json
from markovtools import *
markov = markovtools()
CONSUMER_KEY = 'hzwDs8kA30FZ9Iwcst2BKEYqo'
CONSUMER_SECRET = 'MWcRfaBzDbkAAuZB4z6u10JMimbftoVmLuj7OzKC9VSBuFDL85'
ACCESS_TOKEN_KEY = '1918657698-7E8m7sxr... | null | main.py | main.py | py | 1,056 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "TwitterAPI.TwitterAPI",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 35,
"usage_type": "call"
}
] |
33001452 | from astropy.io import fits
from glob import glob
input = raw_input('Enter file name(s): ')
files = glob(input)
keys = ['radesys', 'pa_aper', 'va_scale',
'wcsaxes',
'crpix1', 'crpix2', 'crpix3',
'crval1', 'crval2', 'crval3',
'cdelt1', 'cdelt2', 'cdelt3',
'cunit1', 'cunit2', 'cu... | null | python_support/lib/move_wcs_keys.py | move_wcs_keys.py | py | 939 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "glob.glob",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 25,
"usage_type": "name"
}
] |
465143045 | import requests
phone = input("phone:")
data2 = {
'MOBILENO': phone,
'TEMP': 1
}
header2 = {
'Referer': 'http://qydj.scjg.tj.gov.cn/reportOnlineService/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0'
}
url2 = 'http://qydj.scjg.tj.gov.cn/reportOnlineServ... | null | msgBoomer/Boomer02.py | Boomer02.py | py | 516 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
}
] |
74622736 | from django.conf.urls import url, include
from django.conf import settings
from rest_framework_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='TODO API')
urlpatterns = [
url(r'^', include('loginsys.urls')),
url(r'^todos/', include('todo.urls')),
]
if settings.DEBUG:
urlpattern... | null | api/urls.py | urls.py | py | 426 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework_swagger.views.get_swagger_view",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.include",
"line_number": 8,
"usage_type": "call"
},
... |
499897412 | # -*- coding: utf-8 -*-
from __future__ import annotations
from collections import deque
from typing import TYPE_CHECKING, Deque
if TYPE_CHECKING:
from pathlib import Path
from pygerber.tokens.token import Token
from pygerber.drawing_state import DrawingState
from .exceptions import DeprecatedSyntax, EndOfS... | null | src/pygerber/tokenizer.py | tokenizer.py | py | 3,910 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pygerber.drawing_state.DrawingState",
"line_number": 22,
"usage_type": "name"
},
{
"api_nam... |
576291144 | import requests,time
class Req():
def __init__(self,url,para=None,header=None):
self.url=url
self.para=para
self.header=header
def req_get(self):
try:
r=requests.get(url=self.url,params=self.para,headers=self.header)
return r
except BaseException... | null | jiekou/Base/Req.py | Req.py | py | 984 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 17,
"usage_type": "call"
}
] |
414207993 | import numpy
from pygame import mixer
import time
from datetime import datetime
import cv2
from tkinter import *
import tkinter.messagebox
root=Tk()
root.geometry('500x570')
frame = Frame(root, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH,expand=1)
root.title('Smart Face Detector')
frame.config(backgro... | null | main_page.py | main_page.py | py | 7,545 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 25,
"usage_type": "call"
},
{
"a... |
241538325 | # -*- coding: utf-8 -*-
from gluon.dal import Expression
from Cache import *
import gluon.contrib.simplejson as JSON
from . import (
SampleTable,
month_number_to_year_month,
units_in_out,
start_month_0_indexed
)
from DSL.Units import MeaninglessUnitsException
from DSL import aggregations
from math i... | null | modules/ClimateDataPortal/MapPlugin.py | MapPlugin.py | py | 21,198 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.floor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.log10",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "rpy2.robjects",
"line_num... |
447570462 | import smtplib
from email.mime.text import MIMEText
from config import email_config
from email.header import Header
my_sender = email_config.sender
my_receivers = email_config.receivers
def mail(content, title):
ret = True
sub = my_receivers
try:
msg = MIMEText(content, 'html', 'utf-... | null | email_push.py | email_push.py | py | 744 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.email_config.sender",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "config.email_config",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "config.email_config.receivers",
"line_number": 7,
"usage_type": "attribute"
},
{
... |
566647248 | #!/usr/bin/env python2.7
'''
A simple test for :class:`EpicsMotor`
'''
import time
import config
from ophyd.controls import EpicsMotor
def test():
def callback(sub_type=None, timestamp=None, value=None, **kwargs):
logger.info('[callback] [%s] (type=%s) value=%s' % (timestamp, sub_type, value))
def ... | null | examples/motor.py | motor.py | py | 1,856 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.setup_loggers",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "config.logger",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "config.motor_recs",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "ophyd.... |
629474085 | import argparse
import codecs
import json
import sys
from itertools import chain
import iso8601
from six import PY3
from six.moves import map
from eliottree import (
Tree, filter_by_end_date, filter_by_jmespath, filter_by_start_date,
filter_by_uuid, render_task_nodes)
def build_task_nodes(files=None, select... | null | eliottree/_cli.py | _cli.py | py | 4,403 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "eliottree.filter_by_start_date",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "eliottree.filter_by_end_date",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "eliottree.filter_by_jmespath",
"line_number": 30,
"usage_type": "call"
},
... |
602430152 | import os
from typing import List, Optional
from gtmcore.gitlib.git_fs import GitFilesystem
from gtmcore.logging import LMLogger
import subprocess
logger = LMLogger.get_logger()
class GitFilesystemShimmed(GitFilesystem):
# INFORMATIONAL
def check_ignored(self, path: str) -> bool:
"""Check if path i... | null | packages/gtmcore/gtmcore/gitlib/git_fs_shim.py | git_fs_shim.py | py | 5,603 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gtmcore.logging.LMLogger.get_logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gtmcore.logging.LMLogger",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "gtmcore.gitlib.git_fs.GitFilesystem",
"line_number": 11,
"usage_type": "name"
... |
349336855 | #!/usr/bin/env python
from pyrocko.model import Event, Station, dump_stations
from pyrocko.moment_tensor import MomentTensor
from pyrocko import util
import sys
import numpy as num
import argparse
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('classify')
mt_params = ['strike', 'd... | null | classify.py | classify.py | py | 5,071 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyrocko.momen... |
96148537 | #!/usr/bin/env python3
# Copyright 2021 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.
"""Creates an server to offload non-critical-path GN targets."""
import argparse
import dataclasses
import json
import logging
import ... | null | build/android/fast_local_dev_server.py | fast_local_dev_server.py | py | 4,394 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
250144440 | import discord
import asyncio
from app.vars.client import client
from app.helpers import notify
from discord.ext import commands
@client.command()
@commands.guild_only()
@commands.has_permissions(kick_members=True)
async def kick(ctx):
try:
if not ctx.message.mentions:
await notify.error(ctx, "... | null | app/events/client/commands/kick.py | kick.py | py | 709 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app.helpers.notify.error",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.helpers.notify",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "asyncio.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "app.helpers... |
72882280 | import numpy as np
from keras.models import Sequential, Model, save_model
from keras.layers import Dense, TimeDistributed, LSTM, GRU, Activation, Dropout, Flatten
from keras.callbacks import Callback, EarlyStopping
from keras import regularizers, optimizers, constraints
from keras.utils import np_utils
import matplotli... | null | src/scripts/experiments/ec_experiment.py | ec_experiment.py | py | 10,160 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
60199911 | """
Load in the data for use in classifiers that require sparse matrices.
"""
import csv
import sys
import numpy as np
from tabulate import tabulate
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import *
from sklearn.neighbors import KNeighborsClassifier
from sklearn.semi_supervis... | null | mask_classification/standard_classifiers/classifiers.py | classifiers.py | py | 9,541 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.exit",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "standard_classifiers.normalize.normalize_text",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "standard_classifiers.normalize.normalize_text",
"line_number": 67,
"usage_type": "... |
525196239 | from pywebostv.connection import *
from pywebostv.controls import *
from wakeonlan import send_magic_packet
import json
from os import system, environ
import pathlib
# Load the client key from environment.
store = {'client_key': environ.get("CLIENT_KEY")}
ip = None
mac = None
first_run = True
last_mute = True
last_po... | null | classes/TV.py | TV.py | py | 6,456 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 6... |
129420262 | import unittest
from HttpClient import HttpClient, HttpRequest, HttpResponse
from xml.dom.minidom import parseString
##
# @file ConfigTest.py
##
"""
The config reportable supports editable attributes
Changes are made via the uri:
/config?action=change&module=<module name>&name=<attr name>&value=<attr value>
The... | null | functionaltests/ConfigTest.py | ConfigTest.py | py | 2,229 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "HttpClient.HttpRequest",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "HttpClient.HttpClient.Execute",
"line_number": 27,
"usage_type": "call"
},
{
"api_n... |
649768329 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""Extra parameters including a bunch from other bots"""
#---------------------------------------
# Libraries and references
#---------------------------------------
import codecs
import winsound
import ast
import sys
import os
import clr
sys.path... | null | Tools/CastorrsLazyPack2/CLP_StreamlabsSystem.py | CLP_StreamlabsSystem.py | py | 9,852 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
464716772 | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.utils import timezone
from .forms import VisitorForm... | null | CRmain_Members/views.py | views.py | py | 4,427 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 16,
"usage_type": "call"
... |
543201297 | import logging
from contrib import web
from django.utils import simplejson
from google.appengine.api import search
from models import ProduceUser
class store_produce:
def POST(self):
# web.header('Access-Control-Allow-Origin', '*')
# web.header('Access-Control-Allow-Credentials', 'true')
produceStore ... | null | webapp/controllers/store_produce.py | store_produce.py | py | 673 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.utils.simplejson.loads",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.utils.simplejson",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "contrib.web.data",
"line_number": 16,
"usage_type": "call"
},
{
"api_name":... |
104269858 | import pygame
import random
fini = False
pygame.init()
###variable terrain et musique###
GRIS = (80,80,80)
VERT = (34,139,34)
BLANC = (255,255,255)
GRIS_CLAIR=(212,211,211)
FENETRE_LARGEUR = 600
FENETRE_HAUTEUR = 800
LARGEUR_COULOIR_ROUTIER = FENETRE_LARGEUR/5.6
LARGEUR_VERT=(69+(4*LARGEUR_COULOIR_ROUTIER)+12)... | null | poursuite.py | poursuite.py | py | 10,632 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.i... |
458997302 | ###################################################################################################
# imports normals to the normal editor's mesh data variable from an existing FBX file
#
# - can import single or multiple meshes' normals (or all)
# - only FBX 6.1 supported for now
#
####################################... | null | scripts/addons_extern/udk_fbx_tools/import_normals.py | import_normals.py | py | 8,146 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mathutils.Vector",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "mathutils.Vector",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "bpy.context",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
... |
501549690 | import json
with open('ID_final.json') as json_data:
d = json.load(json_data)
new_d = {"type": "FeatureCollection","features":[]}
for i in d["features"]:
print(i["type"])
print(i["geometry"]["type"]=="MultiPolygon")
if i["geometry"]["type"] != "MultiPolygon":
new_d["features"]+=[i]
with open('... | null | src/main/resources/static/json/deleteMultiPolygon.py | deleteMultiPolygon.py | py | 396 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 13,
"usage_type": "call"
}
] |
200021266 | import asyncio
import json
import logging
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['http']
REQUIREMENTS = ['python-logstash==0.4.6']
DOMAIN = 'logstash'
CONF_HOST ... | null | custom_components/logstash.py | logstash.py | py | 1,201 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "voluptuous.Schema",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "voluptuous.Schema",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "voluptuous.Requ... |
524072302 | import cmd
import json
from fire import Fire
from websocket import create_connection
from Feynman.algorithms.tree.print_tree import print_tree
class template_cmd(cmd.Cmd):
intro = '''
this is google drive manager
version 0.0.1
'''
prompt = 'google_drive > '
file = None
def do_all(self, ... | null | google_drive_manager/google_drive_cmd.py | google_drive_cmd.py | py | 2,437 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cmd.Cmd",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "Feynman.algorithms.tree.print_tree.print_tree",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "Feynman.algorithms.tree.print_tree.print_tree",
"line_number": 33,
"usage_type... |
110953331 | # uncompyle6 version 3.7.4
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: ./src/bots/discord/config.py
# Compiled at: 2020-04-12 13:41:02
# Size of source mod 2**32: 1837 bytes
import os, logging.config
from colorama import Fore
from ..... | null | pycfiles/lightnovel_crawler-2.21.0-py3-none-any/config.cpython-36.py | config.cpython-36.py | py | 1,384 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 14,
... |
627086676 | from data import question_data
from quiz_brain import QuizBrain
from question_model import Question
question_bank =[]
for i in range(0,len(question_data)):
question=Question(question_data[i]["question"],question_data[i]["correct_answer"])
question_bank.append(question)
quiz = QuizBrain(question_bank)
while... | null | Quizgame/main.py | main.py | py | 374 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "data.question_data",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "question_model.Question",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "data.question_data",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "qui... |
645844658 | #!/usr/bin/env python
# -*- coding:utf-8 -*
"""
# Button plug on a rpi_duino_io
#
# wiring : a pin on 0V
# a pin on a digital io
#
# AUTHOR : FredThx
#
# Project : rpiduino_io
#
"""
from rpiduino_io import *
import logging
class bt_io(digital_input_device_io):
''' Bouton poussoir branchée sur un rpiduino (pcdu... | null | build/lib/FGPIO/bt_io.py | bt_io.py | py | 2,407 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.info",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 89,
"usage_type": "call"
}
] |
567625030 | import cdsapi
import argparse
import calendar
import datetime
c = cdsapi.Client()
monthDict = {1:'Jan', 2:'Feb', 3:'Mar', 4:'Apr', 5:'May', 6:'Jun',
7:'Jul', 8:'Aug', 9:'Sep', 10:'Oct', 11:'Nov', 12:'Dec'}
parser = argparse.ArgumentParser(description='Get ERA5 3D Data.')
parser.add_argument('--year'... | null | era5_download_scripts/download_era5_general.py | download_era5_general.py | py | 1,907 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cdsapi.Client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "calendar.monthrange",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
555284089 |
import numpy as np
from detectron.core.config import cfg
# import matplotlib
# import matplotlib.pyplot as plt
from tools.analyse_detects import coco_classes, KL_div
def print_dist(dist,name):
order = np.argsort(dist)[::-1]
dist = dist[order]
classes = coco_classes[order]
print(name)
for w,c in l... | null | detectron/modeling/PADA.py | PADA.py | py | 8,970 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.argsort",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tools.analyse_detects.coco_classes",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.bincount",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "detec... |
366874720 | import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import os
import time
import numpy as np
import configparser
from glob import glob
from copy import deepcopy
import pickle
from skvideo.io import vwrite
from env import Environment
from replay import ReplayMemory
from IPython import embed
import ... | null | agents/handler.py | handler.py | py | 28,687 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number"... |
239409758 | import uuid
import logging
import datetime
logging.basicConfig(level=logging.INFO)
class Memory():
def __init__(self, content=None):
self._existing = False
self._id = None
self._created = None
self._content = content
self._tags = []
self._links = []
sel... | null | memory.py | memory.py | py | 1,441 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "uuid.uuid4",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now"... |
152808452 | from django.http import HttpResponse
from django.template.loader import get_template
from django.template import Context, Template
from taxy.models import *
import datetime
from googlemaps import GoogleMaps,GoogleMapsError
from math import pi,cos
degree_to_radian = pi/180.0
radian_to_degree = 180.0/pi
"""
del_latlng:... | null | taxy/views.py | views.py | py | 5,718 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.pi",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "math.pi",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "math.cos",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "googlemaps.GoogleMaps",
"line_number": 35... |
14780921 | """
This program shows a company’s profit over the past ten years and displays the
results in a bar graph using Matplotlib.
Name: Cristian Pintor
"""
import os
import matplotlib.pyplot as plt
def main():
file = input('Enter the full filename path: ').strip()
if os.path.isfile(file):
open_file = open(... | null | Assignment-5/cpintor_HW_5/program_3_bar/bar_graph.py | bar_graph.py | py | 1,349 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.isfile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
310227418 | import tweepy
import datetime
import time
CONSUMER_KEY = 'your key' #twitter developer consumver ID
CONSUMER_SECRET = 'your key' #twitter developer consumer secret
ACCESS_KEY = 'your key' #twitter developer access key
ACCESS_SECRET = 'your key' #twitter developer secret
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSU... | null | my_twitter_bot.py | my_twitter_bot.py | py | 3,820 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.ctime",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_numbe... |
96981887 | # coding=utf-8
import os
import socket
import sys
import time
import traceback
import json
# 根据ftp目录文件情况,修改配置文件
def is_chinese(string):
"""
检查整个字符串是否包含中文
:param string: 需要检查的字符串
:return: bool
"""
for ch in string:
if u'\u4e00' <= ch <= u'\u9fff':
return True
return Fa... | null | dev_demo/ftp_log/ext_ftp_log.py | ext_ftp_log.py | py | 2,176 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.name",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "sys.executable.endswith",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.executable",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path",
... |
427286004 | import pygame,sys
from pygame.locals import *
#main game loop
def gox(SCREEN,COLOR,CLOCK,ply):
while True:
SCREEN.fill(COLOR)
#event handler
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
if event.type == KEYDOWN:
if event.key == K_w:
ply.move("up", "go"... | null | loop.py | loop.py | py | 766 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.event.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.event",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.quit",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_num... |
195353535 | # psyLex: an open-source implementation of the Linguistic Inquiry Word Count
# Created by Sean C. Rife, Ph.D.
# srife1@murraystate.edu // seanrife.com // @seanrife
# Licensed under the MIT License
# Function to count and categorize words based on an LIWC dictionary
# this version was tweaked by Maria Priestley, pries... | null | wordCount.py | wordCount.py | py | 2,806 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.OrderedDict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.RegexpTokenizer",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "nltk.FreqDist",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "n... |
219111115 | import random
import math
import arcade
import copy
SCALE = 1 / 2
BLOCK_WIDTH = 10
BLOCK_HEIGHT = 10
WINDOW_WIDTH = 800
WINDOW_HEIGHT = 800
class PlayerSprite(arcade.PlatformerSpriteSheetSprite):
def __init__(self):
super().__init__()
self.texture_change_distance = 10
self.speed = 3
... | null | examples/platformer.py | platformer.py | py | 9,714 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "arcade.PlatformerSpriteSheetSprite",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "arcade.load_textures",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "arcade.load_textures",
"line_number": 42,
"usage_type": "call"
},
{
... |
605523817 | import pytest
tables = pytest.importorskip('tables')
from blaze.compute.hdfstore import *
from blaze.utils import tmpfile
from blaze import symbol, discover, compute
import pandas as pd
from datetime import datetime
from odo import Chunks, resource, into
import os
try:
f = pd.HDFStore('foo')
except (RuntimeError... | null | pkgs/blaze-0.9.1-py27_0/lib/python2.7/site-packages/blaze/compute/tests/test_hdfstore.py | test_hdfstore.py | py | 1,791 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.importorskip",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pandas.HDFStore",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.skip",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_... |
220020339 | from bs4 import BeautifulSoup
from selenium import webdriver
import time
import dload
driver = webdriver.Chrome('chromedriver')
driver.get("https://search.daum.net/search?nil_suggest=btn&w=img&DA=STC&q=%EC%9D%B4%EA%B0%80%EC%9D%80&period=6m&sd=20200401202758&ed=20201001202758") # 여기에 URL을 넣어주세요
time.sleep(5)
req = dri... | null | sparta/homework01.py | homework01.py | py | 681 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSou... |
177589287 | import numpy as np
import time as tm
import re
import warnings
from .. import Utils
from discretize import TreeMesh
def read_GOCAD_ts(tsfile):
"""
Read GOCAD triangulated surface (*.ts) file
INPUT:
tsfile: Triangulated surface
OUTPUT:
vrts : Array of vertices in XYZ coordinates [n x 3]
t... | null | geoapps/simpegPF/Utils/io_utils.py | io_utils.py | py | 29,222 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.any",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 48,
... |
267017355 | # ------------------------------------------------------------------------------
# Lux material shader node for Maya
#
# by Doug Hammond 05/2008
#
# This file is licensed under the GPL
# http://www.gnu.org/licenses/gpl-3.0.txt
#
# $Id$
#
# ------------------------------------------------------------------------------
#... | null | luxPlugin/Lux/LuxNodes/ShaderNodes/glassShader.py | glassShader.py | py | 2,405 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "maya.OpenMayaMPx.MPxNode",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "maya.OpenMayaMPx",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "Lux.LuxNodes.ShaderNode.ShaderNode",
"line_number": 25,
"usage_type": "name"
},
{
... |
46630481 | import math
import pickle
import pandas as pd
import numpy as np
from pathlib import Path
import settings
with open(Path(settings.pickle_path) / "GradientBoost.pickle", "rb") as pickle_model:
model = pickle.load(pickle_model)
def score(Age, SibSp, Parch, Fare, Sex_female, Sex_male, Pclass_1, Pclass_2, Pclass_3, ... | null | examples/data/BiasMetrics/titanicModels/GradientBoost/score_GradientBoost.py | score_GradientBoost.py | py | 2,583 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "settings.pickle_path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"... |
268101663 | import random
from tqdm import tqdm
import numpy as np
from numpy import random as rnp
import pandas as pd
import pathlib
from tslearn.utils import to_time_series_dataset
from tslearn.neighbors import KNeighborsTimeSeries
from tslearn.clustering import TimeSeriesKMeans
import argparse
#remove numpy array from list of... | null | multinode/getBestTrainingNodes.py | getBestTrainingNodes.py | py | 4,636 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array_equal",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
269316214 | from collections import namedtuple
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db.transaction import atomic
from django.shortcuts import render
from django.views.generic import TemplateView
import requests
from rest_framework import status
import json
im... | null | blocklord/views.py | views.py | py | 7,124 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "blocklord.models.PullRequest.objects.all",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "blocklord.models.PullRequest.objects",
"line_number": 27,
"usa... |
636220773 | # -*- mode: python; indent-tabs-mode: nil; -*- coding: iso-8859-1 -*-
"""
BaseSearcher.py
Copyright 2009-2014 by Marcello Perathoner
Distributable under the GNU General Public License Version 3 or newer.
Project Gutenberg Catalog Search
Base class
"""
from __future__ import unicode_literals
from __future__ impor... | null | BaseSearcher.py | BaseSearcher.py | py | 33,892 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "libgutenberg.MediaTypes.mediatypes.mobile",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "libgutenberg.MediaTypes.mediatypes",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "libgutenberg.MediaTypes.mediatypes.opds",
"line_number": 44... |
68893956 | import os, datetime
import logging.config
# 180505
# loggerは粗結合にするため、カスタムライブラリは利用しない
# 180429
# 2階層上がベースパス
current_path = os.path.dirname(os.path.abspath(__file__))
current_part_list = current_path.split('/')
current_part_list.pop()
# base path
BASE_PATH = "/".join(current_part_list)
# 標準出力
LOG_STDOUT_LOG_LEVEL = ... | null | serverless/function/ulogger.py | ulogger.py | py | 3,711 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.config.DEBUG",
... |
238202945 | import pykitti
import matplotlib.pyplot as plt
import cv2
import numpy as np
from tqdm import trange, tqdm
import time
import os
import json
import copy
from frames_to_video import create_video
DEBUG_SAVE_FIG = False
DEBUG_SHOW = False
debug_velo_scatter_fig = plt.figure() if DEBUG_SHOW else None
debug_inverse_fig = p... | null | project1_code/occupancy_mapping_algorithm_velo_to_world_2d_vn_ve.py | occupancy_mapping_algorithm_velo_to_world_2d_vn_ve.py | py | 24,119 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "m... |
589674109 | import scipy as sp
import openpyxl as ox
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import fsolve
# читаем данные
wb = ox.load_workbook(filename = './data.xlsx')
x = list()
y = list()
ws = wb['Sheet1']
for cell in ws['A']:
x.append(float(cell.value))
for cell in ws['B']:
y.append(float... | null | mpl/exByOpenpyxl.py | exByOpenpyxl.py | py | 1,771 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matp... |
38357627 | # -*- coding: utf-8 -*-
import time
from datetime import datetime,timedelta
from lxml import etree
import netsvc
from osv import osv, fields, orm
import decimal_precision as dp
from tools.translate import _
import logging
logger = logging.getLogger('DOTCOM_LOGGER_AGENCIA')
class dotcom_venda(osv.osv):
_name='do... | null | dotcom_intervencoes/venda.py | venda.py | py | 6,706 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "osv.osv.osv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "osv.osv",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "osv.fields.one2many",
... |
289145455 | from odf.text import P
class Cell(object):
"""docstring for Cell"""
def __init__(self, parent, ods_cell=None):
self.parent = parent
self.ods_cell = ods_cell
@property
def Text(self):
if not hasattr(self, '_text'):
textContent = None
if self.ods_cell:
... | null | SpreadsheetDOM/ods/Cell.py | Cell.py | py | 1,247 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "odf.text.P",
"line_number": 14,
"usage_type": "argument"
}
] |
423348061 | #!/usr/bin/python
"""
Starter code for the evaluation mini-project.
Start by copying your trained/tested POI identifier from
that which you built in the validation mini-project.
This is the second step toward building your POI identifier!
Start by loading/formatting the data...
"""
import pickl... | null | evaluation/evaluate_poi_identifier.py | evaluate_poi_identifier.py | py | 1,685 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "feature_format.featureForma... |
376036486 | """
定义网络模型的两种方式,第二种为简便方法
"""
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import matplotlib.pyplot as plt
# Method 1
class Net(torch.nn.Module):
def __init__(self, n_feature, n_hidden, n_output):
super(Net, self).__init__()
self.hidden = torch.nn.Linear(n... | null | python/pytorch_test/an_easy_way.py | an_easy_way.py | py | 669 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"li... |
608711490 | from setuptools import setup, find_packages
install_requires = [
'click==7.0',
'requests==2.22.0',
'colorama==0.4.1',
'bumpversion==0.5.3',
'structlog==19.1.0'
]
setup(
name='downdetect',
version='0.0.1',
author='Joshua Groeschl',
author_email='joshua.groeschl@tutanota.com',
de... | null | setup.py | setup.py | py | 682 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 26,
"usage_type": "call"
}
] |
14655716 | """ 20150212. Author: Cazatron """
import random
from random import randint
from math import *
from PIL import Image
def build_random_function(min_depth, max_depth):
""" Builds a random function of depth at least min_depth and depth
at most max_depth
min_depth: the minimum depth of the random fu... | null | computational_art/recursive_art.py | recursive_art.py | py | 6,272 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
"lin... |
550648228 | # coding:utf-8
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery, platforms
from celery.schedules import crontab
# set the default Django settings module for the 'celery' program.
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'API.production_settings')
os.environ.... | null | API/API/celery.py | celery.py | py | 1,688 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.setdefault",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "celery.Celery",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "celery.platforms.C_... |
359138950 |
import random
import matplotlib.pyplot as plt
import numpy as np
NGEN = 1000 # 迭代次数
popsize= 100 # 种群个数
# var_num = 5 # 变量维度
# var_num = 10 # 变量维度
# var_num = 30 # 高维情况下需要增加种群的个数
var_num = 50 # 高维情况下需要增加种群的个数
lb = [-32.768 for _ in range(var_num)]
ub = [32.768 for _ in range(var_num)]
class PSO:
def __... | null | pso3.py | pso3.py | py | 2,848 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
86133773 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import requests
import time
import logging.config
import os
import json
from Queue import Queue
from lxml import html
from dbqueue import MongoDBQueue
WORKED_THREADS = 10
LOGGER_CONF = 'eatthissite/data/logging.json'
logger = logging.getLogger('eatthis... | null | eatthissite/__init__.py | __init__.py | py | 9,812 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.config.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.config",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logging.config.DEBUG",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "log... |
458359472 | import os
import cv2
import json
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import load_model
from flask import Flask, request
from datetime import datetime
import warnings
warnings.filterwarnings("ignore")
app_hostname = "127.0.0.1"
app_port = "80"
app_model... | null | FinalProject/Application/server.py | server.py | py | 1,929 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": ... |
366411167 | import pickle
from pprint import pprint
from config.Config_worker import Config
from keras.preprocessing.sequence import pad_sequences
from keras.models import *
import numpy
class CNNProbEmbeddings:
def __init__(self):
self.config = Config(model_type='cnn')
self.task_type = self.config.get('Ta... | null | CNN_tagger/CNNProbEmbeddings.py | CNNProbEmbeddings.py | py | 4,422 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.Config_worker.Config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 123,
"usage_type": "call"
}
] |
623477595 | #
# Project: MXCuBE
# https://github.com/mxcube.
#
# This file is part of MXCuBE software.
#
# MXCuBE is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | null | HardwareObjects/EMBL/EMBLDetector.py | EMBLDetector.py | py | 10,650 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "AbstractDetector.AbstractDetector",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "HardwareRepository.BaseHardwareObjects.HardwareObject",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "AbstractDetector.AbstractDetector.__init__",
"line_nu... |
636878951 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import torch
from pytorch3d import _C
def knn_points_idx(
p1,
p2,
K: int,
lengths1=None,
lengths2=None,
sorted: bool = False,
version: int = -1,
):
"""
K-Nearest neighbors on point clouds.
Args:
p... | null | pytorch3d/ops/knn.py | knn.py | py | 6,722 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.full",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "torch.int64",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "torch.full",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "torch.int64",
"line_number... |
193524236 | # imdb, info = tfds.load('imdb_reviews', with_info=True, as_supervised=True)
import tensorflow as tf
from tensorflow.keras import layers, regularizers
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
import tensorflow_datasets as tfds
import n... | null | questions/q_8.py | q_8.py | py | 4,101 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.keras.backend.clear_session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.random.set_seed",
"line_number": 15,
"usage_type": "call"
},
... |
648423827 | import logging
import tweepy.errors
from delab.models import Tweet
from delab.delab_enums import PLATFORM
from delab.tw_connection_util import send_tweet
logger = logging.getLogger(__name__)
def publish_moderation(instance):
try:
delab_admission = " (This was automatically send by the deliberation app)... | null | delab/bot/sender.py | sender.py | py | 1,084 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "delab.models.Tweet.objects.filter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "delab.models.Tweet.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
... |
258912583 | #!/usr/bin/env python3
import re
import subprocess
import utils
def keyboard():
conf = utils.read_conf("keyboard")
emblem = conf.get("emblem", "")
sym_numlock = conf.get("sym_numlock", "1")
sym_capslock = conf.get("sym_capslock", "A")
color = conf.get("color", "000000")
color_active = conf.g... | null | src/keyboard.py | keyboard.py | py | 1,316 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.read_conf",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.search",
"li... |
103922390 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import urllib2
import urllib
import unittest
from bs4 import BeautifulSoup
import xml.etree.ElementTree as ET
import MySQLdb
from time import sleep
NBABASEURL = "http://www.pk2015.net/top/nba_top5.asp"
SOCCERURL = "http://www.pk2015.net/top/game_top5.asp"
class pk2015_da... | null | datadump/pk_data_parse.py | pk_data_parse.py | py | 9,262 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "MySQLdb.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTr... |
400145851 | import numpy as np
import h5py
import os
from os import listdir
from os.path import isfile, join
import json
class caclGAME:
def __init__(self,groundtruthPath,predictionPath):
self.groundtruthPath = groundtruthPath
self.predictionPath = predictionPath
self.item = [item for item in os.listdir... | null | PreStage/Predict/calc_GAME.py | calc_GAME.py | py | 2,819 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_numb... |
546149972 | import torch
import torch.nn as nn
import torch.nn.functional as F
from models.utils import AdditiveAttention
class UserEncoder(torch.nn.Module):
def __init__(self, config):
super(UserEncoder, self).__init__()
self.config = config
self.mh_selfattention = nn.MultiheadAttention(
... | null | project/models/sentirec/user_encoder.py | user_encoder.py | py | 1,179 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.MultiheadAttention",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.utils.Additi... |
54778332 | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | null | azext_iot/central/command_map.py | command_map.py | py | 1,691 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "azure.cli.core.commands.CliCommandType",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "azure.cli.core.commands.CliCommandType",
"line_number": 16,
"usage_type": "call"
}
] |
430728202 | from plugins import Notifier
import subprocess
from gamez.Logger import *
from lib import requests
class Boxcar(Notifier):
version = "0.4"
_config = {'email': ''}
def _sendTest(self):
log("Testing boxcar")
self.sendMessage("You just enabled Boxcar on Gamez")
def sendMessage(self, msg... | null | plugins/notifier/Boxcar.py | Boxcar.py | py | 1,058 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "plugins.Notifier",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "lib.requests.post",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "lib.requests",
"line_number": 25,
"usage_type": "name"
}
] |
347660011 | import cv2
import numpy as np
import matplotlib.pyplot as plt
img= cv2.imread('sudoku.png')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray = cv2.GaussianBlur(gray, (5, 5), 0)
edges = cv2.Canny(gray, 50, 150, apertureSize = 3)
#lines = cv2.HoughLines(edges, 1, np.pi/180,50)
lines = cv2.HoughLines(edges, 0... | null | hough transform/hough line.py | hough line.py | py | 958 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"... |
441436183 | import numpy as np
import pandas as pd
import os
from utils import read_boxes_from_txt
from img_utils import compute_area, cal_centeroid
def cat_dict_handler(cat_dict, op_name):
cat_dict_temp = cat_dict.copy()
assert op_name in ['min', 'max', 'mean', 'std']
if op_name == 'min':
op = np.min
elif... | null | analysis.py | analysis.py | py | 1,976 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.min",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.max",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.mean",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.std",
"line_n... |
515250269 | # coding=utf-8
import dash
import dash_html_components as html
import dash_core_components as dcc
import plotly.graph_objects as go
import pandas as pd
import time
import datetime as dt
import dash_table
def get_data():
global df_nazionale, df_regioni, df_province
df_nazionale = pd.read_csv("https://raw.gi... | null | step1.py | step1.py | py | 2,907 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime... |
205444055 | import azure.cognitiveservices.speech as speechsdk
def from_file(file):
speech_config = speechsdk.SpeechConfig(subscription="3785c3171b694795ad5e7ec2bc01ab7f", region="canadacentral")
audio_input = speechsdk.AudioConfig(filename=file)
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_con... | null | speechconfig.py | speechconfig.py | py | 1,065 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "azure.cognitiveservices.speech.SpeechConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "azure.cognitiveservices.speech",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "azure.cognitiveservices.speech.AudioConfig",
"line_number": 6,
"... |
560835169 | __author__ = 'Jianjie Yu'
import requests,json
import time
import datetime
class TweetCollection():
crawl_web_prefix=str()
request_status={"success":200,"fail":404}
api_web_prefix=str()
sub_fix_str1=str()
sub_fix_str2=str()
sub_fix_str3=str()
api_sub_fix1=str()
api_sub_fix2=str()
ap... | null | get_twitter.py | get_twitter.py | py | 4,804 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
111221934 | from urllib.request import urlopen
from bs4 import BeautifulSoup
import ssl
import re
totcoms = 0
cnt = 0
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = input('Enter - ')
html = urlopen(url, context=ctx).read()
soup = BeautifulSoup(html, "html.parser")
tags = so... | null | OnlineClasses/Programming for Everybody/Class3/ex12_5.py | ex12_5.py | py | 519 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ssl.create_default_context",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ssl.CERT_NONE",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "b... |
136113299 | import math
import torch
import torch.nn as nn
import torchvision
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth'
}
path_to_save = "./data/"
load_state = {'None', 'Pretrained', 'Load'}
def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_pla... | null | tuned_resnet18.py | tuned_resnet18.py | py | 6,700 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.