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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
981584569 | import argparse
import random
def main():
args = parse_args()
compile_random_pattern(args.n, args.output)
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('n', type=int, help='dimension of output file (power of 2)')
parser.add_argument('output', type=argparse.FileType('wb... | hjbyt/OS_HW5 | compile_random.py | compile_random.py | py | 725 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 26,
"usage_type": "call"
}
] |
31881700577 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('a_home.urls')),
path('about/', include('a_home.urls')),
path('portfolio/', include('a_por... | V0lodimirV/Flower_site | a_configuration/a_configuration/urls.py | urls.py | py | 1,307 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dja... |
42099837809 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
print('make pre-encoded tcga data from 2048')
import os
import sys
import csv
import numpy as np
import pickle
from PIL import Image
import tensorflow as tf
import tensorflow_ae_base
from tensorflow_ae_base import *
import tensorflow_util
impo... | naono-git/cnncancer | make_tcga_encoded2_2048.py | make_tcga_encoded2_2048.py | py | 1,884 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.initialize_all_variables",
"line_number": 45,
"usage_type": "call"
},
{
... |
28440071535 | import pandas as pd
import os
from datetime import datetime
from sqlalchemy import create_engine
from load_data import load_data
from transform_data import transform_data
from config import DB_NAME,PASSWORD,USER
def insert_data_incremental(df_to_upload, table_name):
"""
Inserts data from a DataFrame into a Pos... | manu2492/Data-Transformation-Pipeline-Analyzing-and-Enriching-Trip-Data | etl/update_database.py | update_database.py | py | 4,029 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "config.USER",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "config.PASSWORD",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "config.DB_NAME",... |
2515527479 | import sqlite3
connection = sqlite3.connect("rpg_db.sqlite3")
connection.row_factory = sqlite3.Row
curs = connection.cursor()
# 1). How many total Characters are there
total_characters = """
SELECT COUNT(*) FROM charactercreator_character;
"""
results = curs.execute(total_characters).fetchall()
print("total Characte... | Edudeiko/DS-Unit-3-Sprint-2-SQL-and-Databases | module1-introduction-to-sql/321_assignment.py | 321_assignment.py | py | 3,321 | python | en | code | null | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 5,
"usage_type": "attribute"
}
] |
31929838287 | import re
from collections import defaultdict
class ReviewSentence():
def __init__(self, line):
self.sentiment = line[:3]
self.text = line[4:]
class Review():
def __init__(self, header):
self.header = header
a, b, c = header.split("_")
self.review_category = a
self.review_sentiment = b
self.sentences ... | hmdavis/NLP-project-2 | NLP-project-3/parsers.py | parsers.py | py | 2,192 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 68,
"usage_type": "call"
}
] |
15791070220 | import Preprocessing as pre
from Classifiers import accuracy, RandomForestClassifier, confusion_matrix
import time
import h5py
import numpy as np
import argparse
import joblib
def RFClassifier(X_train, y_train, X_val, y_val, n_trees, tree_depth, split_metric, name, jobs):
clf = RandomForestClassifier(n_trees=n_tr... | samedwardsFM/Next-level-random-forest-from-scratch | Final_run.py | Final_run.py | py | 2,841 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Classifiers.RandomForestClassifier",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.asarray"... |
71578930343 | import vtk
def main():
colors = vtk.vtkNamedColors()
# create a sphere
sphere = vtk.vtkSphere()
sphere.SetRadius(1)
sphere.SetCenter(1, 0, 0)
# create a box
box = vtk.vtkBox()
box.SetBounds(-1, 1, -1, 1, -1, 1)
# combine the two implicit functions
boolean = vtk.vtkImplicitBo... | lorensen/VTKExamples | src/Python/ImplicitFunctions/Boolean.py | Boolean.py | py | 2,132 | python | en | code | 319 | github-code | 36 | [
{
"api_name": "vtk.vtkNamedColors",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "vtk.vtkSphere",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "vtk.vtkBox",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "vtk.vtkImplicitBoolean",
... |
37716835129 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='EventCategory',
fields=[
... | vinsmokemau/Eventstarter | events/migrations/0002_auto_20151014_0134.py | 0002_auto_20151014_0134.py | py | 833 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
25459718320 | from __future__ import absolute_import, division, print_function
import numpy as np
np.random.seed(1337) # for reproducibility
np.set_printoptions(threshold=np.nan)
import tensorflow as tf
tf.enable_eager_execution()
import os
import matplotlib.pyplot as plt
import pickle
import networkx as nx
import SegEval as ev
fr... | remrace/qnguyen5-thesis-tamucc | src/bin/test.py | test.py | py | 11,127 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.seed",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
... |
37220401007 | import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import utils
from TGATlayer import TGATlayer
class TGATML(nn.Module):
def __init__(self, adjm, node_feats,in_dim=1,out_dim=24, residual_channels=2,dilation_channels=2, end_channels=2*10, layers=5, reg_param=0):
super().__init__()
... | shiql/TGAT-ML | TGATML.py | TGATML.py | py | 4,454 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
11814225329 | import sqlite3
from sqlite3 import Error
from datetime import date
class PatientDataStore():
"""
Stores patient information in sqlite3 database
"""
__instance = None
@staticmethod
def getInstance():
"""
This is a static method to create class as a singleton
"""
... | Rumone/ai-project | patient_data_store.py | patient_data_store.py | py | 2,314 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.date.today",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
... |
494837227 | from dagster_graphql.test.utils import execute_dagster_graphql
from dagster.core.instance import DagsterInstance
from .utils import define_test_context, sync_execute_get_run_log_data
COMPUTE_LOGS_QUERY = '''
query ComputeLogsQuery($runId: ID!, $stepKey: String!) {
pipelineRunOrError(runId: $runId) {
... ... | helloworld/continuous-dagster | deploy/dagster_modules/dagster-graphql/dagster_graphql_tests/graphql/test_compute_logs.py | test_compute_logs.py | py | 1,983 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "utils.sync_execute_get_run_log_data",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "dagster_graphql.test.utils.execute_dagster_graphql",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "utils.define_test_context",
"line_number": 37,
"us... |
28418729236 | # Implementation of Selenium WebDriver with Python using PyTest
import pytest
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
import sys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Ke... | syedsair/rateer-automated-tests | UI/signup.py | signup.py | py | 2,374 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 20,
"usage_type": "call"
},
... |
26469573974 | import codecs
import hashlib
import base58
from bitcoinaddress.util import checksum
from bitcoinaddress import Wallet
from bitcoinutils.keys import PrivateKey
from bitcoinutils.setup import setup
import ecdsa
from ecdsa.curves import SECP256k1
from ecdsa.util import sigencode_der_canonize
from .base import BaseKey
... | ProtoconNet/mitum-py-util | src/mitumc/key/keypair.py | keypair.py | py | 2,852 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "common.parseType",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "base.BaseKey",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "hint.KEY_PRIVATE",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "base.BaseKey",
... |
15370165912 | import pytest
import sqlalchemy as sa
import sqlalchemy.orm
import jessiql.sainfo.version
from apiens.tools.sqlalchemy.session.session_tracking import TrackingSessionMaker, TrackingSessionCls
@pytest.mark.xfail(jessiql.sainfo.version.SA_13, reason='Session() is not a context manager in SA 1.3', )
def test_tracking_s... | kolypto/py-apiens | tests/tools_sqlalchemy/test_session_tracking.py | test_session_tracking.py | py | 1,330 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sqlalchemy.engine",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "apiens.tools.sqlalchemy.session.session_tracking.TrackingSessionMaker",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 26,
"usage_ty... |
5353044388 | import pandas as pd
import ipywidgets as widgets
from ipylabel.templates import Table
class ImageDashboard():
'''
Abstract dashboard class for image data.
'''
def __init__(self, images, format='png'):
if format not in ['png', 'jpg']:
raise ValueError('Format must be either png... | crabtr26/ipylabel | ipylabel/Dashboards.py | Dashboards.py | py | 1,704 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ipywidgets.Image",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "ipylabel.templates.Table",
"line_number": 52,
"usage_type": "call"
}
] |
19793018115 | # -*- coding: utf-8 -*-
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.externals.six import StringIO
from IPython.display import Image
from sklearn.tree import export_graphviz
import... | oykuandac/Entropy-Gini-Indexes-Prediction | exercise.py | exercise.py | py | 5,568 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "s... |
34899584843 |
from calendar import weekday
class Employee():
num_of_emps = 0
raise_amount = 1.04
def __init__(self, first, last, pay):
self.first = first
self.last = last
self.pay = pay
self.email = first + '.' + last + '@gmail.com'
Employee.num_of_emps +=1
d... | sangramdhurve/Oops_python | Working with Classes.py | Working with Classes.py | py | 1,530 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.date",
"line_number": 41,
"usage_type": "call"
}
] |
71073486183 | #!/usr/bin/env python3
import argparse
import logging
import pathlib
import time
import signal
import shutil
import numpy as np
import yaml
import tensorboardX
import torch
import torch.utils.data
import utils
from tasks.arithmetic import Arithmetic
from models.lstm import LSTM
from models.ntm import NTM
from models... | dasimagin/ksenia | train_arithmetic.py | train_arithmetic.py | py | 10,912 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "numpy.random.choice",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.geometric",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.ra... |
16560146527 | """empty message
Revision ID: da088c937095
Revises: ecc7f6cfc777
Create Date: 2022-08-02 16:55:48.199125
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'da088c937095'
down_revision = 'ecc7f6cfc777'
branch_labels = None
depends_on = None
def upgrade():
# ... | nukano0522/flask_apps | image_detection/migrations/versions/da088c937095_.py | da088c937095_.py | py | 685 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
12151473251 | import numpy as np
import math
import random
import matplotlib.pyplot as plt
NUM_DIMENSIONS = 10
NUM_PARTICLES = 50
MAX_ITERATIONS = 100
INERTIA_WEIGHT = 0.729
COGNITIVE_WEIGHT = 1.49445
SOCIAL_WEIGHT = 1.49445
MIN_POSITION = -5.12
MAX_POSITION = 5.12
def f1(position: np.ndarray):
fitness = np.sum(position**2 - 1... | dvher/AlgoritmosExactosMetaheuristica | Tarea3/main.py | main.py | py | 3,848 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.ndarray",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 1... |
9092725521 | import helpers
import numpy as onp
import enum
class Methods(enum.Enum):
Sturm = enum.auto()
SturmOriginal = enum.auto()
FactorGraph = enum.auto()
FactorGraphGT = enum.auto()
number_samples = 50
parameter_set_rot = {
"stddev_pos": onp.array([0.001, 0.03, 0.1]),
"stddev_ori": onp.array([1.0,... | SuperN1ck/cat-ind-fg | only_poses/run_all.py | run_all.py | py | 2,174 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "enum.auto",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 9,
... |
42406705027 | """A matrix is a collection of scalar values arranged in rows and columns as a rectan-
gular grid of a fixed size. The elements of the matrix can be accessed by specifying
a given row and column index with indices starting at 0.
"""
from typing import Any
from py_ds.arrays.array import Array
from py_ds.arrays.array2d ... | jurajzachar/py-ds | py_ds/arrays/matrix.py | matrix.py | py | 6,832 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "py_ds.arrays.array2d.Array2D",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "py_ds.arrays.array.Array",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "py_ds.arrays.array2d.Array2D",
"line_number": 56,
"usage_type": "call"
},
{
... |
17887209605 | from pdb import Pdb
class Powerdb(Pdb):
def precmd(self, line):
if not isinstance(line, str): return line
return super().precmd(line)
def onecmd(self, line):
self.prompt = '--> '
# print('line:', line)
if line == ':r':
self.message('%-15s' % '[Step Out....]... | pyminer/pyminer | pyminer/utils/debug/pdbtest.py | pdbtest.py | py | 3,956 | python | en | code | 77 | github-code | 36 | [
{
"api_name": "pdb.Pdb",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "linecache.getline",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": ... |
33434928097 | from django.views.decorators.http import require_http_methods
from django.http import HttpResponse
import os
def get_file(fpath):
if os.path.isfile(fpath):
return open(fpath, 'rb').read()
else:
return None
# 显示图片
@require_http_methods(["GET"])
def show_image(request):
pic_addr = str(requ... | XuYiFanHHH/QingXian_Back-end | QingXian/views.py | views.py | py | 489 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.isfile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.views.decor... |
36287589774 | from django.shortcuts import render, redirect, HttpResponse
from . import functions
# Create your views here.
# 真正的登录在home函数中
def login(request):
if request.session.get('is_login', None): # 将登录信息保存到session中实现重复调用
return redirect('/home/')
return render(request, 'login.html', {'error': False}) # 将err... | Spetrichor/database_project | app01/views.py | views.py | py | 9,068 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 17,
"usage_type": "call"
},
{
"api_na... |
10492838240 | import open3d as o3d
import copy
from modern_robotics import *
down_voxel_size = 10
icp_distance = down_voxel_size * 15
result_icp_distance = down_voxel_size * 1.5
radius_normal = down_voxel_size * 2
def cal_angle(pl_norm, R_dir):
angle_in_radians = \
np.arccos(
np.abs(pl_norm.x*R_dir[0]+ pl... | chansoopark98/3D-Scanning | test_color_icp.py | test_color_icp.py | py | 3,645 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "copy.deepcopy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "open3d.geometry.KDTreeSearchParamHybrid",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "o... |
1934215882 | import pandas as pd
import matplotlib.pyplot as plt
Data_Raw = pd.read_csv('iris.data',sep=',',header=-1)
Unique_Label = pd.unique(Data_Raw.values[:,4])
NUmeric_Label = Data_Raw[4].apply(list(Unique_Label).index)
count = 0
colors = ['red','green','blue','purple']
for i in Unique_Label:
Temp = Data_Raw... | melikaknight/Iris-Dataset | P4c.py | P4c.py | py | 513 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.unique",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
27501697384 | from datetime import datetime
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
with DAG(dag_id="airtable-download",
start_date=datetime(2021, 11, 1),
concurrency=1) as dag:
download_time_tracker_base = DummyOperator(task_id="download-time-tracker-base",
... | ktechboston/kt-public-dags | dags/airtable-example/airtable-download.py | airtable-download.py | py | 908 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "airflow.DAG",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "airflow.operators.dummy_operator.DummyOperator",
"line_number": 10,
"usage_type": "call"
},
{
"api_na... |
74518816744 | # -*- coding: utf-8 -*-
#!/usr/bin/python3
from mitmproxy.options import Options
from mitmproxy.proxy.config import ProxyConfig
from mitmproxy.proxy.server import ProxyServer
from mitmproxy.tools.dump import DumpMaster
import argparse
GOOGLE_URL = 'googleapis.com'
class Addon(object):
def __init__(self, token)... | ThibaultLengagne/gta | start_mitm_proxy.py | start_mitm_proxy.py | py | 1,655 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mitmproxy.tools.dump.DumpMaster",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "mitmproxy.tools.dump.DumpMaster.run",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "mitmproxy.tools.dump.DumpMaster",
"line_number": 37,
"usage_type": "n... |
15737275688 | import fnmatch
from ftplib import FTP
import ftplib
import io
import os
import requests
from tqdm import tqdm
import os
import time
import gzip
import xml.etree.ElementTree as ET
import csv
directory = "D:/gg/"
filenames = os.listdir(directory)
print(filenames)
ftp_server = ftplib.FTP("ftp.ncbi.nlm.nih.gov", "anonymou... | wanhoyinjoshua/authorship | nftp.py | nftp.py | py | 1,596 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ftplib.FTP",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ftplib.FTP",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 53,
... |
23542375248 | from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
my_url = 'https://www.newegg.com/Video-Cards-Video-Devices/Category/ID-38?Tpk=graphic+cards'
#opening connection and grabbing page
uClient = uReq(my_url)
page_html = uClient.read()
#close the client
uClient.close()
#html parsing
page_s... | vallab/hackerrank_dashboard | first_scrap.py | first_scrap.py | py | 380 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
}
] |
30843941779 | import SimpleITK as sitk
import numpy as np
#!/usr/bin/python2.6
# -*- coding: utf-8 -*-
import os
import matplotlib.pyplot as plt
from PIL import Image
import pandas as pd
import sys
'''python import模块时, 是在sys.path里按顺序查找的。
sys.path是一个列表,里面以字符串的形式存储了许多路径。
使用A.py文件中的函数需要先将他的文件路径放到sys.path中
'''
sys.path.append('..//'... | JiabinTan/LUNA16 | data_proc/reader_disp.py | reader_disp.py | py | 4,833 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "SimpleITK.ReadImage",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "SimpleITK.GetArrayF... |
74872310504 | import pandas as pd
import plotly.figure_factory as pf
import statistics
data = pd.read_csv('./height-weight.csv')
heigth = data['Height(Inches)'].tolist()
mean = statistics.mean(heigth)
median = statistics.median(heigth)
mode = statistics.mode(heigth)
stan = statistics.stdev(heigth)
# caluculating per... | KARNAMROOPESH/Python13 | distribution.py | distribution.py | py | 2,204 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "statistics.median",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "statistics.mode",
... |
18934606840 | from django import template
from django.conf import settings
from wagtail.images.models import SourceImageIOError
from wagtail.images.templatetags.wagtailimages_tags import ImageNode
from django.utils.safestring import mark_safe
from common.templatetags.string_utils import uid
register = template.Library()
@register... | IATI/IATI-Standard-Website | common/templatetags/responsive.py | responsive.py | py | 9,878 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "django.template.Library",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.template.TemplateSyntaxError",
"line_number": 46,
"usage_type": "call"
},
{
"api_nam... |
27472478696 | from time import sleep
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.mail.message import EmailMultiAlternatives
from django.core.management.base import BaseCommand
from django.core.validators import validate_email
class Command(BaseCommand):
help = 'Send ema... | DariuszAniszewski/codepot-heroku-workshop | codepot/management/commands/send_email.py | send_email.py | py | 1,511 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.EMAIL_HOST",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 14,
"usage_type": "nam... |
13463415841 | import os
import gc
import dill
import warnings
warnings.filterwarnings(action='ignore', category=UserWarning)
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import KFold
from sklearn.multioutput import MultiOutputRegressor
import lightgbm as lgb
f... | romden/kaggle | 2022_09_single-cell-integration/train_lgb_cite.py | train_lgb_cite.py | py | 4,566 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "dill.load",
"lin... |
21735015266 | import os
import random
import cv2
from ultralytics import YOLO
from tracker import Tracker
import numpy as np
import copy
from frame import Frame
def Analyser():
video_path = os.path.join(os.getcwd(), 'assets', 'people.mp4')
video_out_path = os.path.join(os.getcwd(), 'assets', 'people_out.mp4')
... | KushJoshi16/CrowdInflowOutflow | VideoAnalyser.py | VideoAnalyser.py | py | 2,949 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
71480593704 | from dotenv import load_dotenv
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from kafka import KafkaProducer
import os
load_dotenv()
access_token = os.environ.get('ACCESS_TOKEN')
access_token_secret = os.environ.get('ACCESS_TOKEN_SECRET')
consumer_key = os.envir... | luciferreeves/KafkaPySpark | producer.py | producer.py | py | 1,350 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
... |
14656471260 | import requests
import json
import logging
import os
import time
import uuid
from collections import Counter
API_URL = os.environ.get('API_URL') or 'https://api.gooee.io'
LOGGER = logging.getLogger()
LOGGER.setLevel(logging.INFO)
# Sentry Setup
SENTRY_ENVIRONMENT = 'TMPL_SENTRY_ENVIRONMENT'
SENTRY_RELEASE = 'TMPL_SEN... | GooeeIOT/cloud-alexa-control-lambda | lambda_function.py | lambda_function.py | py | 16,236 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"li... |
22209550187 | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in... | terual/sbcc | module/setup.py | setup.py | py | 3,921 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "module.pysqueezecenter.server.Server",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "socket.er... |
18456187648 | from __future__ import unicode_literals
from udsactor.log import logger
from . import operations
from . import store
from . import REST
from . import ipc
from . import httpserver
from .scriptThread import ScriptExecutorThread
from .utils import exceptionToMessage
import socket
import time
import random
import os
imp... | karthik-arjunan/testuds | actors/src/udsactor/service.py | service.py | py | 13,012 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "udsactor.log.logger.logger.isWindows",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "udsactor.log.logger.logger",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "udsactor.log.logger",
"line_number": 30,
"usage_type": "name"
},
... |
11783204177 | #######################
# Imports
#######################
from pandas.tseries.offsets import DateOffset
import streamlit as st
import plotly.graph_objects as go
import plotly.io as pio
from pmdarima import auto_arima
import numpy as np
pio.renderers.default = 'browser'
import pandas as pd
from sqlalchemy i... | EkaterinaTerentyeva/Streamlit | streamlit_app.py | streamlit_app.py | py | 11,082 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "plotly.io.renderers",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "plotly.io",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "streamlit.container",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "streamlit.colu... |
981587259 | import argparse
import math
def main():
args = parse_args()
decompile_pattern(args.input, args.output)
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('input', type=argparse.FileType('rb'), help='input pattern file')
parser.add_argument('output', type=argpars... | hjbyt/OS_HW5 | decompile_pattern.py | decompile_pattern.py | py | 1,149 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.sqrt... |
37584223577 | import numpy as np
import plotly.offline as py
import plotly.graph_objs as go
import pandas as pd
data = pd.read_csv("../data/training_data.csv")
# print(data.head())
X = data.values[:,0]
Y = np.array([])
np.percentile(X, [25,50,75])
nd=pd.qcut(X,3, labels=[0,1,2])
nd2=pd.qcut(X,3, labels=["close","not close","far"])... | lmEshoo/sensors-anomoly-detection | src/cluster_percentile.py | cluster_percentile.py | py | 1,157 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.qcut",
"line_nu... |
23412397140 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('compras', '0018_auto_20151108_1208'),
]
operations = [
migrations.Alte... | pmmrpy/SIGB | compras/migrations_1/0019_auto_20151108_1747.py | 0019_auto_20151108_1747.py | py | 2,202 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 16,
"usage_type": "call"
},
{... |
43229153536 | import requests
def buscar_avatar(usuario):
"""
Buscar o avatar de um usuario no GitHub
:param usuario: str com o nome de usuario do github
:return: str com o link do avatar
"""
url = f'https://api.github.com/users/{usuario}'
resp = requests.get(url)
return resp.json()['avatar_url']
... | wartrax13/libpythonpro | libpythonpro/github_api.py | github_api.py | py | 386 | python | pt | code | 1 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
}
] |
17888210285 | import numpy
import pytest
from pyminer_algorithms import *
def test_transpose():
# 测试一维矩阵
a = numpy.ones((3,))
assert matrix_transpose(a).shape == (3, 1)
# 测试二维矩阵
a = numpy.ones((3, 4))
assert matrix_transpose(a).shape == (4, 3)
# 测试三维矩阵
a = numpy.ones((3, 4, 5))
with pytest.ra... | pyminer/pyminer | tests/test_algorithms/test_linear_algebra/test_matrix_transpose.py | test_matrix_transpose.py | py | 406 | python | en | code | 77 | github-code | 36 | [
{
"api_name": "numpy.ones",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 18... |
36635815592 | #Caching Mode
from config import api_id, api_key, account_id, site_ip, get_site_status
import requests
url_cache_mode = 'https://my.imperva.com/api/prov/v1/sites/performance/cache-mode'
def modify_cache_mode():
with open('./domain.txt', 'r', encoding="utf-8") as file:
domain_site = get_site_status... | coeus-lei/python | imperva/ModifyCacheMode.py | ModifyCacheMode.py | py | 851 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "config.get_site_status",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.api_id",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.api_key",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "requests.post",
... |
22635877529 | import pathlib
from .. import utils # noqa, pylint: disable=unused-import
from .. import enclosures
class TemplateEnclosurePlugin(enclosures.EnclosurePlugin): # noqa: V102
"""
The default enclosure plugin, expands a template into the target path.
"""
# Default a hierarchy under the feed title and ... | rpatterson/feed-archiver | src/feedarchiver/enclosures/template.py | template.py | py | 1,888 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
}
] |
30533093290 | import cv2
import numpy as np
import os
from glob import glob
from tqdm import tqdm
#image = cv2.imread(r'C:\Users\mbarut\Desktop\car detection\vehicle-speed-counting\traffic.jpg')
"""
print(image.shape)
area = np.array([[552,605],[560,760],[1211,652],[1127,590]],np.int32)
color = (255, 0, 0)
thickness = 2
... | MehmetBarutcu/ObjectDetectionApp | car detection/vehicle-speed-counting/trial.py | trial.py | py | 1,808 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_... |
28832230499 | from MoocletCreationAutomator.secure import MOOCLET_API_TOKEN
import requests
import json
class MoocletConnector:
def __init__(self, token=MOOCLET_API_TOKEN):
self.token = MOOCLET_API_TOKEN
self.url = "https://mooclet.canadacentral.cloudapp.azure.com/engine/api/v1/"
def create_mooclet_object... | Intelligent-Adaptive-Interventions-Lab/MturkDeploymentAutomater | MoocletCreationAutomator/MoocletConnector.py | MoocletConnector.py | py | 2,227 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "MoocletCreationAutomator.secure.MOOCLET_API_TOKEN",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "MoocletCreationAutomator.secure.MOOCLET_API_TOKEN",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 14,
"usa... |
8503903259 | import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk # import pillow library for images
Title_Font = ("Century Gothic", 15)
MARK_IV_Heading_Font = ("Century Gothic", 25)
Headline_Font = ("Century Gothic", 16)
imageMonash= "monash-university-malaysia_2.png"
def popMessage(msg):
pop = tk.Tk()... | Veinga/FIT-2101 | assignment_1/marking_software.py | marking_software.py | py | 7,332 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tkinter.Tk",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Label",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.Button",
"li... |
5048789180 | import os
from flask import Blueprint, flash, redirect, render_template, request, url_for, send_from_directory
from flask_login import current_user, login_required, login_user, logout_user
from auth.methods import AuthMethod
from catalog.methods import CatalogMethod
from category.methods import CategoryMethod
from ite... | or73/Catalog_App | application/modules/catalog/views.py | views.py | py | 3,583 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "category.methods.CategoryMethod.get_all_categories",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "category.methods.CategoryMethod",
"line_number": 22,
"usage_type": "na... |
15212822365 | #import libraries
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
from dash import Dash, dcc, html, Input, Output
#Connect to Cloud SQL using the Cloud SQL Python connector
#define your app object
app = Dash(__name__)
#--Import and clean data(importing csv into pandas)
#df = pd.read... | RichardLadson/bees | bees.py | bees.py | py | 2,259 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dash.Dash",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dash.html.Div",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number"... |
12607877643 | # 本地Chrome浏览器设置方法
from selenium import webdriver
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from bs4 import BeautifulSoup as bs
# from selenium... | Kenny3Shen/CodeShen | Code/Python/queryMyScores/queryScores.py | queryScores.py | py | 7,792 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aip.AipOcr",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.wait.W... |
70539349223 | import torch
import operator
from sema2insts import Sema2Insts, expr2graph
import json
import random
from time import time
import z3
from z3_exprs import serialize_expr
from synth import synthesize, sigs, check_synth_batched
llvm_insts = [inst for inst in sigs.keys() if inst.startswith('llvm')]
inst_pool = []
with op... | ychen306/upgraded-succotash | test-synth.py | test-synth.py | py | 2,618 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "synth.sigs.keys",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "synth.sigs",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sema2insts.Sema2Insts",
"lin... |
21955928918 | from RepSys import Error, config, layout
from RepSys.svn import SVN
from RepSys.util import execcmd
from RepSys.util import get_output_exec
from io import StringIO
import sys
import os
import os.path
import re
import time
import locale
import glob
import tempfile
import shutil
import subprocess
locale.setlocale(loc... | DrakXtools/repsys | RepSys/log.py | log.py | py | 27,147 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "locale.setlocale",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "RepSys.svn.SVN",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
15883229551 | import time
import random
import json
import hashlib
import requests
import mysql.connector as mc
from mysql.connector import Error as mce
import sys
my_key='your key from API'
my_secret='your secret from API'
rand_prefix = str(random.randint(100000,999999))
now = str(int(time.time()))
method_name = 'problemset.proble... | ineed-coffee/CAC-Code-Forces-Algorithm-Classifier- | make_db.py | make_db.py | py | 1,915 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "random.randint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "hashlib.sha512",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numb... |
69981548263 | from collections import defaultdict
import math
import torch
import torch.nn as nn
from algorithm.trainer import SampleBatch, feed_forward_generator, recurrent_generator
def get_gard_norm(it):
sum_grad = 0
for x in it:
if x.grad is None:
continue
sum_grad += x.grad.norm()**2
r... | garrett4wade/revisiting_marl | algorithm/trainers/mappo.py | mappo.py | py | 6,597 | python | en | code | 19 | github-code | 36 | [
{
"api_name": "math.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.optim.Adam",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "torch.optim.Adam",
"l... |
74497317225 | from flask import Flask, render_template, request, flash, redirect, url_for, session, g
import os
import secrets
from PIL import Image
from HackSite.deeplearning.classification import predict
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(... | BenVN123/AircraftClassificationDL | HackSite/__init__.py | __init__.py | py | 3,992 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number":... |
44210008243 | # -*- coding: utf-8 -*-
#!usr/bin/evn python3
#这一部分用来理解正规标达式 / 日期运算
#备注:当要搜寻特定文字时可以使用正规表达式
"""
Created on Tue Nov 7 13:56:09 2017
@author: vizance
"""
#===正规表达式与匹配文字组合(资料分析中,字段资料的大小写匹配非常重要)===
#呼叫re模组(正规表达式模组,使用中继字元来匹配各种文字组合)
#中继字元如 |、()、[]、*、+、?、^、$、(?P<name>)
import re #re模组用来创造或搜寻各种文字组合
string = "The quick bro... | vizance/Python_Data_Analysis | 第一章_基礎介紹/基本練習2_正規表達式與日期運算.py | 基本練習2_正規表達式與日期運算.py | py | 4,376 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 32,
"us... |
22776411105 | from jira import JIRA
import re
import json
import requests
import browser_cookie3
import creds as creds
#connect to jira instance
jiraOptions = {'server' : creds.url
}
jira = JIRA(server=jiraOptions, token_auth=creds.api_token)
#get list of issues
issues = []
def getIssues():
print('Searhing fo... | SBotalov/sd_automation | sd_granting_access.py | sd_granting_access.py | py | 4,477 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "creds.url",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "jira.JIRA",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "creds.api_token",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "jira.search_issues",
... |
23072964772 | from behave import given, when, then
from hamcrest import assert_that, equal_to, raises
from LinkList.src.linkList import LinkList
@given(u'nodes are created')
def add_node(context):
for row in context.table:
context.model.add_node(row["node"])
@given(u'All nodes are reset')
def delete_list(context):
... | rushikeshnakhate/HackaThon | python/LinkList/test/bdd/steps/countNumberOfNodesStepsDefinition.py | countNumberOfNodesStepsDefinition.py | py | 2,220 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "behave.given",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "LinkList.src.linkList.LinkList",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "behave.given",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "behave.when",... |
7939048922 | import math
from collections import defaultdict
from fractions import gcd
class Point:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def __sub__(self, p2):
return Point(self.x-p2.x, self.y-p2.y)
def __str__(self):
return "(" + str(int(self.x)) + ", " + str(int(self.y)) +")"
def __re... | deepspacepirate/googlefoobar | L4-bringing_a_gun_to_a_guard_fight.py | L4-bringing_a_gun_to_a_guard_fight.py | py | 3,170 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fractions.gcd",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 45... |
32846353410 | # This program downloads a list of files from an NCBI FTP site that are delineated in a csv file.
# Assumes that the CSV file has a header, and skips the first row.
# ARGUMENT1 - CSV file that contains the URLs of the files to download.
# ARGUMENT2 - The suffix of the files to download. i.e. "_genomic.fna", "_protei... | platipenguin/metaproteomics-database-optimization | jupyter_notebooks/DownloadFromNCBIFTPtxt.py | DownloadFromNCBIFTPtxt.py | py | 2,950 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number"... |
12445974610 | from django.http import HttpResponse
from django.shortcuts import render
from rest_framework import viewsets
from rest_framework import status
from rest_framework.decorators import api_view
from django.views.decorators.csrf import csrf_exempt
from djangoTest import settings
from oAuth.models import User, OauthStockDat... | lff12876/DjangoWeb2023 | oAuth/views.py | views.py | py | 31,531 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "oAuth.models.stockdata20204",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "oAuth.models.stockdata20211",
"line_number": 36,
"usage_type": "name"
},
{
"api_nam... |
19123385662 | #!/usr/bin/env Python3
# Web scraping script for fun
import requests
from bs4 import BeautifulSoup
def scrape_website(url):
response = requests.get(url)
if response.status_code == 200:
soup = BeautifulSoup(response.content, "html.parser")
links = soup.find_all("a")
for link in links:... | Caedesium/PythonPractice | Scripts1.0/webscraper1.py | webscraper1.py | py | 561 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
}
] |
13498558067 | import pyttsx3 #pip install pyttsx3
import speech_recognition as sr #pip install speechRecognition
import datetime
import wikipedia #pip install wikipedia
import webbrowser
import os
import smtplib
import cv2
from time import ctime
import time
from requests import get
import sys
import pywhatkit as kit
from googletrans... | ruchiparmar7/jarvis | jarvis.py | jarvis.py | py | 32,964 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pyttsx3.init",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "psutil.cpu_percent",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "psutil.sensors_battery",
... |
10589524750 | from pathlib import Path
from enum import Enum
DEFAULT_FILE_CONTENT_VALUE = ""
DEFAULT_CURRENT_LINE_CONTENT_VALUE = []
PARAMETER_OPEN = "<"
PARAMETER_CLOSE = ">"
START_KEYWORD = "$"
KEYWORDS_TABLE = \
(
"$CREATE_FILE",
"$LINK",
"$FILE",
"$TEXT",
"$TARGET"
)
class KEYW... | Cijei03/TextFilesMerger | Parser.py | Parser.py | py | 5,126 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 91,
"usage_type": "call"
}
] |
40152665258 | """Edit a 'rotomap' series of images.
In all modes:
Press 'q' to quit.
Press 'Q' to quit with exit code 1.
Press left for previous image, right for next image.
Press up for previous map, down for next map.
Ctrl-click on a point to zoom in on it.
Press 'z' or 'x' to adjust the zoom level.
P... | aevri/mel | mel/cmd/rotomapedit.py | rotomapedit.py | py | 22,318 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "mel.lib.common.rotomap",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "mel.lib.common",
"line_number": 75,
"usage_type": "name"
},
{
"api_name": "argparse.FileType",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "pygame.... |
28632705196 | import time
import traceback
import functools
from functools import update_wrapper
from flask import request, make_response, current_app
from datetime import timedelta
from densefog import config
from densefog import logger
from densefog.common import jsonable
from densefog.common import local
from densefog.error_code... | hashipod/densefog | densefog/web/grand.py | grand.py | py | 5,280 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "densefog.common.local.start_context",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "densefog.common.local",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "densefog.logger.info",
"line_number": 37,
"usage_type": "call"
},
{
"ap... |
69928483943 | print('Loading...')
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator, MultipleLocator, AutoMinorLocator
from matplotlib.axes import Axes
import pandas as pd
import numpy as np
import time
import math
import seaborn as sns
from IPython.display import clear_output, display, IFrame
from chord imp... | Err0neus/Santos-Discography-Analyser | functions/UI.py | UI.py | py | 80,024 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "nltk.download",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.s... |
20803043179 | from django.contrib import messages
def info(request, msg):
"""
Log the message to the current page template if request is not None. Log msg
to stdout also.
"""
assert len(msg) > 0
if request is not None:
messages.info(request, msg, extra_tags="alert alert-secondary", fail_silently=True... | Robinqiuau/asxtrade | src/viewer/app/messages.py | messages.py | py | 999 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.messages.info",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.messages.warning",
"line_number": 21,
"usage_type": "call"
},
{
... |
14715992978 | from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String, Numeric, text
engine = create_engine('postgresql://postgres:1@localhost/news_db', echo = True)
meta = MetaData() # box
students = Table(
'students' , meta ,
Column('id' , Integer , primary_key=True),
Column('first_name' , S... | devabsaitov/self_study | sqlalchemy_lesson/Basic/3_insert _expression.py | 3_insert _expression.py | py | 912 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy... |
23403038536 | #1
import mysql.connector
connection = mysql.connector.connect(
host = '127.0.0.1',
port = 3306,
database = 'flight_game',
user = 'dbuser',
password = 'pass_word'
)
def showairport(icao):
sql = "select ident, name, iso_country from airport"
sql += " WHERE ident='" + icao + "'"
print(sql)... | nguyenhis/MODULE8 | main.py | main.py | py | 3,024 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 3,
"usage_type": "name"
},
{
"api... |
40965965237 | from django.urls import path
from django.views.decorators.cache import cache_page, never_cache
from catalog.apps import CatalogConfig
from catalog.views import HomeView, ContactsView, ProductDetailView, ProductListView, ProductDeleteView, \
ProductCreateView, \
ProductUpdateView, BlogRecordListView, \
Blog... | DSulzhits/06_2_3 | catalog/urls.py | urls.py | py | 2,135 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "catalog.apps.CatalogConfig.name",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "catalog.apps.CatalogConfig",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"... |
19141473384 | import matplotlib.pyplot as plt
import sys
from numpy import *
def _poly(a, x):
"""Returns the function value of a polynomial with coefficients a and variable x.
Parameters
----------
a : list
a list of coefficients
x : number
the variable of the polynomial
Returns
-------... | wiLLSE23/DAT455 | Labs/Labb3/numpy_regression.py | numpy_regression.py | py | 2,675 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 91,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
3207468200 | from __future__ import annotations
import re
from typing import Any, Callable, NamedTuple
def parse(rows: list[str]) -> Board:
width = max(len(row) for row in rows)
board_rows = [" " * (width + 2)]
for index in range(len(rows) - 2):
row = rows[index]
board_rows.append(f" {row}" + " " * (wi... | heijp06/AoC-2022 | day22/board.py | board.py | py | 10,253 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.findall",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 144,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 145,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"l... |
29296183032 | from django.views import generic # 2nd
from other.models import Ramadan, Feature
#==========================================================
class RamadanListView(generic.ListView):
model = Ramadan
paginate_by = 4
class RamadanDetailView(generic.DetailView):
model = Ramadan
#======================... | anowar143/django-news-frontend | src/other/views.py | views.py | py | 509 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "other.models.Ramadan",
"line_number": 8,
"usage_type": "name"
},
{
"api_nam... |
24854285401 | import requests
STOCK_NAME = "TSLA"
COMPANY_NAME = "Tesla Inc"
STOCK_ENDPOINT = "https://www.alphavantage.co/query"
NEWS_ENDPOINT = "https://newsapi.org/v2/everything"
api_key = "6KPNON1CEDUUZNPO"
news_api_key = "9738bfb7f9b648b197ca544a5d4da261"
stock_parameters = {
"function": "TIME_SERIES_DAILY",
"symbol... | rkhidesh/100-Days-Of-Code | 100 Days/day36/main.py | main.py | py | 1,035 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
}
] |
39946543852 | import json
import pathlib
from function import handler
from testing.mock import LambdaContext
current_dir = pathlib.Path(__file__).parent.resolve()
def test_message_ept_good_request() -> None:
"""Test /message endpoint with good request"""
with open(
f"{current_dir}/data/test_message_ept_good_reques... | AlgoWolf-com/aw2-api-backend | api-gateway/user-api/tests/function_test.py | function_test.py | py | 984 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "function.handler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "testing.mock.LambdaContext",
... |
42022013353 | import pandas as pd
from docx import Document
def get_lst():
df = pd.read_excel('Sample_Questions_Compliance.xls')
lst = []
for index, row in df.iterrows():
lst.append((row['Model Question'], row['Additional Tags / Synonyms for questions (from QnA Chatbot)'],row['Model Answer']))
wordDoc ... | silasalberti/gpt3-comprehendum | backend/intelligent_parse.py | intelligent_parse.py | py | 1,145 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "pandas.read_excel",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "docx.Document",
"line_number": 11,
"usage_type": "call"
}
] |
28295707377 | #!/bin/env python3
import nltk
# load the grammar and sentences
grammar = nltk.data.load("grammars/atis-grammar-original.cfg")
sents = nltk.data.load("grammars/atis-test-sentences.txt")
sents = nltk.parse.util.extract_test_sentences(sents)
parser = nltk.parse.BottomUpChartParser(grammar)
for sent, _ in sents:
tr... | zouharvi/uds-student | computational_linguistics/hw3/generate_gold_counts.py | generate_gold_counts.py | py | 464 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.data.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nltk.data",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "nltk.data.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.data",
"line_numbe... |
26822270635 | import requests
import json
import openpyxl
import pandas as pd
from dotenv import load_dotenv
load_dotenv()
import os
import time
import asyncio
import aiohttp
api_key_binance = os.environ.get('API_B')
api_secret_binance = os.environ.get('SECRET_B')
async def get_binance_futures_tickers():
url = 'https://fapi.bin... | BobbyAxer/Binance_funding_calc | main.py | main.py | py | 3,519 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
... |
8758398775 | # -*- coding: utf-8 -*-
from odoo import api, fields, models
import base64
from cStringIO import StringIO
import xlsxwriter
from xlsxwriter.utility import xl_range, xl_rowcol_to_cell
class OFRapportGestionStockWizard(models.TransientModel):
_name = "of.rapport.gestion.stock.wizard"
product_ids = fields.Many2... | odof/openfire | of_sale_stock/wizard/of_report_tableur_wizard.py | of_report_tableur_wizard.py | py | 10,613 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "odoo.models.TransientModel",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Many2many",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "odoo.... |
40838375848 | import re, os, sys
pathjoin = os.path.join
try:
import configparser
except ImportError:
# Python 2
import ConfigParser as configparser
from .keplerian import keplerian
import pysyzygy as ps
from .utils import need_model_setup, get_planet_mass, get_planet_semimajor_axis,\
percentile68_ra... | j-faria/kima-light | pykimalight/display.py | display.py | py | 28,337 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "io.BytesI... |
42147496534 | from pydantic import BaseModel
class ServiceInfo(BaseModel):
name: str
service_type: str
namespace: str
classification: str = "None"
deleted: bool = False
def get_service_key(self) -> str:
return f"{self.namespace}/{self.service_type}/{self.name}"
def __eq__(self, other):
... | m8e/robusta | src/robusta/core/model/services.py | services.py | py | 670 | python | en | code | null | github-code | 36 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 4,
"usage_type": "name"
}
] |
12598914400 | # Write a program where only the process with number zero reports on how many processes there are in total.
from mpi4py import MPI
comm = (
MPI.COMM_WORLD
) # Default communicator in MPI. Groups processes together all are connected.
proc_nom = comm.Get_rank() # Current process number.
nom_procs = comm.Get_size(... | GMW99/mpi-examples | exercises/2.5.py | 2.5.py | py | 423 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 6,
"usage_type": "name"
}
] |
12939715941 | """
AlexNet Keras Implementation
BibTeX Citation:
@inproceedings{krizhevsky2012imagenet,
title={Imagenet classification with deep convolutional neural networks},
author={Krizhevsky, Alex and Sutskever, Ilya and Hinton, Geoffrey E},
booktitle={Advances in neural information processing systems},
pages={1097--11... | vedantbhatia/xAI-image-classifiers | AlexNet.py | AlexNet.py | py | 3,154 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Activation",
"line_number": 35,
"usage_type": "... |
28890469001 | """Public interface to top-level pytype functions."""
import contextlib
import dataclasses
import logging
import os
import sys
import traceback
from typing import Optional
import libcst
from pytype import __version__
from pytype import analyze
from pytype import config
from pytype import constant_folding
from pytyp... | google/pytype | pytype/io.py | io.py | py | 11,659 | python | en | code | 4,405 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pytype.config.Options",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "pytype.config",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "pytype.loa... |
73599802024 | from typing import List
def insert_at(original: List, value: int, target_index: int) -> List:
#return original[:i] + [value] + original[i:] (python version)
new_list = [0] * (len(original)+1) #(java version)
index = -1
for index in range(target_index):
new_list[index] = original[index]
new... | amark02/ICS4U-Classwork | Lists/list_functions.py | list_functions.py | py | 778 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 29,
"usage_type": "name"
}
] |
25430599066 |
import requests
class Github:
def __init__(self):
self.name = "Github"
self.base_url = 'https://api.github.com'
self.description = "This service is all about Github."
self.actions = ["detect_new_repository", "detect_new_follower", "detect_new_following"]
self.reactions = ... | arkea-tech/DEV_area_2019 | server/Components/github_service.py | github_service.py | py | 855 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
}
] |
27942071843 | import argparse
from src.screen import Screen
def check_difficulty():
difficulty = input("What difficulty do you want to play?\n 1-)easy 2-)medium\n 3-)hard\n")
if difficulty == '1' or difficulty=='easy':
main('easy')
elif difficulty == '2' or difficulty=='medium':
main('medium')
eli... | DantasEduardo/minefield | main.py | main.py | py | 1,421 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "src.screen.Screen",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 33,
"usage_type": "call"
}
] |
9817005327 | import os,torch,warnings,sys
import numpy as np
from Schrobine import *
import matplotlib.pyplot as plt
global args
warnings.filterwarnings('ignore')
SetSeed()
args = Parse()
labelupdateindex=100
TureLabel = torch.from_numpy(np.load('Label1024.npy')).long()
ActuralLabel = torch.from_numpy(np.load('Label1024.npy')).long... | suzuqiang/TMECH-09-2022-14281 | 函数测试.py | 函数测试.py | py | 1,194 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",... |
43509231022 | import socket
import threading
from ConnectionHandler import ConnectionHandler
from enum import Enum
class Role(Enum):
SERVER = 1
CLIENT = 2
class NetworkInterface:
def __init__(self):
self.listeners = []
self.connectionHandler = ConnectionHandler()
self.running = True
def s... | ChrisWindmill/NWS | 01 Network Examples/18 Wait for server to be available/NetworkInterface.py | NetworkInterface.py | py | 2,518 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "ConnectionHandler.ConnectionHandler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "socket.AF_... |
74050346024 | import os
import random
from collections import defaultdict
from parlai.tasks.md_gender.build import build
"""
Gender utilities for the multiclass gender classification tasks.
"""
MASK_TOKEN = '[MASK]'
MASC = 'male'
FEM = 'female'
NEUTRAL = 'gender-neutral'
NONBINARY = 'non-binary'
UNKNOWN = 'unknown'
SELF_UNKNOWN... | facebookresearch/ParlAI | parlai/tasks/md_gender/utils.py | utils.py | py | 8,435 | python | en | code | 10,365 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "os.path.join",... |
25873666341 | from flask import Flask,render_template,request,redirect,url_for
import tweepy
import textblob
import pandas as pd
import numpy as np
app= Flask(__name__)
@app.route('/', methods = ['POST', 'GET'])
def data():
consumer_key= "*********"
consumer_secret= "**********"
access_token= "**********"
access_to... | harman4498/Tweet_Sentiment_Analysis | sentiment.py | sentiment.py | py | 1,694 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
... |
8555906265 | import torch
import torch.nn as nn
import torch.autograd as autograd
import torch.nn.functional as F
import numpy as np
torch.set_num_threads(8)
class Model(nn.Module):
def __init__(self,
hidden_dim = 512,
representation_len=300,
dropout = .5,
... | mrwangyou/IDSD | repLearning/cnn.py | cnn.py | py | 2,495 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "torch.set_num_threads",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.