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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30864085052 | """ A python wrapper around CReduce that works on SourcePrograms.
`Reducer` takes care of setting up and running CReduce. The reduction
script is implemented in as a `ReductionCallBack`, e.g.:
class ReductionCheck(ReductionCallback):
def __init__(self, san: Sanitizer, ...):
self.san = san
...
... | DeadCodeProductions/diopter | diopter/reducer.py | reducer.py | py | 8,238 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "diopter.compiler.SourceProgram",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "inspect.get... |
31861257223 | from flask import Flask, request, jsonify, make_response
from flask import Flask, request, jsonify, make_response
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from service1 import sendToIDQueue
import json
import time
from createDB import Base, Pa... | Ayush5047/Assignment4 | Rabbitmq/microservice1.py | microservice1.py | py | 2,098 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "createDB.Base.metadata",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "crea... |
27067055941 | import base_model_GCE as base
import numpy as np
import random
import matplotlib.pyplot as plt
rep = 20
T = 15
M = 10
K = 100
A = 25
h = 1
v = 5
alpha = 5
varphi = 1.5
CEdomain = np.linspace(800,1700,num=20)
list_profits = []
list_amounts = []
list_costs = []
for k in range(4):
... | megurkan/IAMM_meg | numerical3.py | numerical3.py | py | 2,367 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number... |
38985151939 | import pandas as pd
import pandas_datareader.data as web
import datetime
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
pd.set_option('display.max_colwidth', -1)
i... | parksy0109/assessingstockvaluewithpython | src/main/prophet/ProphetService.py | ProphetService.py | py | 1,425 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.set_option",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.set_option"... |
34691215233 | import json
import re
import os
from elasticsearch import Elasticsearch
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from nltk.tokenize import word_tokenize
# Global variables for multiprocessing, clean is for the cleaning files and index is for the indexing files
SPLITS_clean = min(os.cpu_co... | sbthepotato/DAT640-Project-22H | indexing/functions_indexing.py | functions_indexing.py | py | 7,049 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.cpu_count",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"... |
72120180347 | import requests
import json
# DB에 데이터 추가하는 함수. 밑에 'new_data' 있는 정보를 DB에 삽입.
def insert_data(data):
for new_data in data:
post = {'book_num': new_data['book_num'], 'question': new_data['question'],'c_answer': new_data['c_answer'],'f_answer1': new_data['f_answer1'],'f_answer2': new_data['f_answer2'],'f_answe... | bagpad/mathgaki | update_db.py | update_db.py | py | 4,261 | python | ko | code | 2 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
42792126133 | from flask import Flask
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from flask_dropzone import Dropzone
import config
db = SQLAlchemy()
migrate = Migrate()
def create_app():
app = Flask(__name__)
app.config.from_object(config)
# ORM
db.init_app(app)
migrate.init_ap... | kdh4672/flask_dhkong | ai_world/__init__.py | __init__.py | py | 860 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_migrate.Migrate",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "views.mai... |
73582507068 | #!/usr/bin/env python3
#TODO Think of new name for tasks and refactor
#TODO Implement menu by category
#TODO Add some functionality for plain notes
#TODO Add functionality to view days score
#Maybe rename file
import sqlite3, os, json
class Task:
def __init__(self, task_id, name, points, category, recurring, dis... | rjames711/Life_Scorer | Life_Scorer/interface.py | interface.py | py | 6,570 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_numb... |
40424673159 | import math as M
import time
from numba import cuda, vectorize, guvectorize, jit, njit
import numpy as np
from matplotlib import pyplot as plt, animation, offsetbox
import matplotlib.cm as cm
from C import C
import cupy as cp
import cairo
class FDTD_2D:
def __init__(self):
# mpl.use('Agg')
self.Le... | pmikola/MPE_proof | FDTD_2d.py | FDTD_2d.py | py | 16,744 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numba.jit",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numba.jit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.seterr",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
... |
74457816506 | from datetime import datetime
import logging
from models.mongodb_models import *
from mongoengine import *
def clear_database():
Vendor.objects().delete()
User.objects().delete()
Article.objects().delete()
RankedArticle.objects().delete()
Feedback.objects().delete()
def fill_database():
#drop ... | jeschkies/nyan | shared_modules/unit_tests/FillTestDatabase.py | FillTestDatabase.py | py | 6,376 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datetim... |
2766959656 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 11 18:52:30 2023
RE4017 Project 2
signdetector.py
NB Command line argument of img file name including extension required
@author: Finn Hourigan 17228522
Ronan Reilly 18242367
Brendan Lynch 18227651
Barry Hickey 182436... | finnh98/RE4017-Sign-Detector | Project_2/signdetector.py | signdetector.py | py | 2,975 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "roifinder.find_ROIs",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "classifier.classify_img",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "PIL.Image.o... |
26994546990 | """empty message
Revision ID: 060966e9e52e
Revises: b8728ad3297c
Create Date: 2020-07-18 00:42:45.019374
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '060966e9e52e'
down_revision = 'b8728ad3297c'
branch_labels = None
depends_on = None
def upgrade():
# ... | aadilahmed/fs_class_demos | todoapp/migrations/versions/060966e9e52e_.py | 060966e9e52e_.py | py | 1,056 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.alter_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.INTEGER",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op.drop... |
11741283863 |
import pandas as pd
df=pd.read_csv('textAnalytics-twitter-sentiment-train.csv')
df
df.describe()
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(min_df=0, lowercase=False)
vectorizer.fit(df['text'])
len(vectorizer.vocabulary_)
from sklearn.model_selection import train_te... | soheilnematihaji/Twitter_Sentiment_Simple_Classification | textAnalytics-git.py | textAnalytics-git.py | py | 3,040 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 24,
"usage_type"... |
28220985130 | #Import Necessary Packages
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from scipy.stats import norm
from scipy.optimize import curve_fit
def load_rmsf(path):
raw = open('../../' + path + '/analysis/rmsf_ref_self.txt').readlines()
r = np.zeros(len(raw))
for i in range(len(raw)... | ajfriedman22/PTP1B | compare_mutant_scripts/rmsf_mut_compare.py | rmsf_mut_compare.py | py | 7,592 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
73073856827 | from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
import KratosMultiphysics
from KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis import FluidDynamicsAnalysis
import sys
import time
import math
import datetime
cla... | frawahl/kratos-testcases | SmallCutConstraints/testing_NSE_square/testing/MainKratos.py | MainKratos.py | py | 2,948 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis.FluidDynamicsAnalysis",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 22,
"usage... |
29560147825 |
import os
import sys
import shutil
import casadi as cs
import numpy as np
from copy import copy
import matplotlib
import matplotlib.pyplot as plt
from acados_template import AcadosOcp, AcadosOcpSolver, AcadosModel
from math import sqrt
import time
from collections import deque
from tqdm import trange
class px4_quad:
... | shiqicao1964/gtg | mpc_nonlinear.py | mpc_nonlinear.py | py | 20,317 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 26,
... |
28911381700 | '''
利用parse模块模拟post请求
分析百度词典
分析步骤:
1.打开F12
2.尝试输入单词girl,发现每敲一个字母后都有请求
3.请求地址是:http://fanyi.baidu.com/sug
4.利用Network->ALL->Headers,查看发现FormData的值是kw:gril
5.检查返回格式内容,发现返回的是json格式内容->需要用到json包
'''
from urllib import request,parse
# 负责处理json格式的模块
import json
'''
大致流程是:
1.利用data构造内容,然后urlopen打开
2.返回一个json格式的结果
3.结果就应该是g... | RogerLiu111/StudySth | Python/爬虫/案例V5.py | 案例V5.py | py | 1,636 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "urllib.parse.urlencode",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "urllib.req... |
39342970355 | import datetime
import json
DATE_FORMAT = "%Y-%m-%d"
def date_to_string(date):
return date.strftime(DATE_FORMAT)
def string_to_date(string):
return datetime.datetime.strptime(string, DATE_FORMAT)
def segment_month_date(start, end):
"""
start : YYYY-MM-DD
end : YYYY-MM-DD
"""
start_dat... | Leouldan/pyfbook | pyfbook/facebook/date.py | date.py | py | 6,051 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "... |
19580167246 | """Adagrad Optimizer"""
from torch.optim import Adagrad as _Adagrad
class Adagrad:
"""
Implements Adagrad optimizer.
Supported Arguments:
learning_rate=0.001: (Float) Learning Rate for the optimizer
learning_rate_decay=(0.9,0.999) : (Float) Learning Rate decay
eps=0 : (Float) Ter... | imdeepmind/NeuralPy | neuralpy/optimizer/adagrad.py | adagrad.py | py | 2,191 | python | en | code | 78 | github-code | 6 | [
{
"api_name": "torch.optim.Adagrad",
"line_number": 55,
"usage_type": "name"
}
] |
34490616549 | # To add a new cell, type '# #'
# To add a new markdown cell, type '# # [markdown]'
# # [markdown]
# # 3.7 softmax回归的简洁实现
# #
import torch
from torch import nn
from torch.nn import init
import numpy as np
import sys
sys.path.append("D:/Deeplearning/Dive-into-DL-PyTorch-master/code")
import d2lzh_pytorch as d2l
print... | Sandy1230/Dive-into-DL-PyTorch-master | code/chapter03_DL-basics/3.7_softmax-regression-pytorch.py | 3.7_softmax-regression-pytorch.py | py | 1,844 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.__version__",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "d2lzh_pytorch.lo... |
21310369818 | # discord imports
import discord
from discord.ext import commands
# other imports
import img
# functions
def SimpleEmbed(author):
Embed = discord.Embed(
colour=discord.Colour.light_gray()
)
Embed.set_author(name=author, icon_url=img.ImgStudyMode)
return Embed
class StudyMode(commands.Cog):
... | mattmoody05/SchoolBot | cogs/study_mode.py | study_mode.py | py | 2,421 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "discord.Embed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.Colour.light_gray",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.Colour",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "img.ImgSt... |
110213436 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# QualiGPT-v0.1.0-alpha Created by: @He Albert Zhang
import sys
import pandas as pd
import openai
import traceback
import nltk
from docx import Document
from nltk.tokenize import sent_tokenize
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QVBoxLa... | KindOPSTAR/QualiGPT | QualiGPTApp.py | QualiGPTApp.py | py | 31,165 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 89,
"usage_type": "call"
},
{
"a... |
8834058286 | """Amazon Web Services."""
# pylint: disable=import-outside-toplevel
import json
import os
import subprocess
import typing
from typing import Dict, Iterator, List, Optional, Tuple
from sky import clouds
from sky import exceptions
from sky.clouds import service_catalog
if typing.TYPE_CHECKING:
# renaming to avoi... | xzg2022/skypilot | sky/clouds/aws.py | aws.py | py | 14,437 | python | en | code | null | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "subprocess.run",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "subproc... |
7129771243 | #!/usr/bin/env python
# transitionning to python2/python3 support
# uncomment from this compatibility import list, as py3/py2 support progresses
from __future__ import print_function
from __future__ import division
# from __future__ import absolute_import
# from __future__ import unicode_literals
# from future impor... | YeoLab/chim-eCLIP | bin/parse_cutadapt.py | parse_cutadapt.py | py | 8,053 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.getsize",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 194,
"usage_type": "call"
}
] |
72666210748 | from django.db import models
class Entity(models.Model):
"""
All objects which will be added to the system will inherit
from this object.
"""
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
class C... | geek911/ecommerce | inventory/models.py | models.py | py | 1,126 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateTimeField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name... |
71829624828 | import datetime
from pathlib import Path
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase, override_settings, Client, RequestFactory
from django.urls import reverse, reverse_lazy
from ... | dkratzert/messlog | tests/test_views.py | test_views.py | py | 17,981 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "scxrd.models.models.CrystalSupport.objects.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scxrd.models.models.CrystalSupport.objects",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "scxrd.models.models.CrystalSupport",
"line_num... |
22756320072 | from stackstate_checks.base.stubs import topology as top
from .conftest import BaseApiTest, set_cloudtrail_event
from stackstate_checks.aws_topology.resources.rds import create_cluster_arn
from mock import patch
class TestRds(BaseApiTest):
def get_api(self):
return "rds"
def get_account_id(self):
... | StackVista/stackstate-agent-integrations | aws_topology/tests/test_rds.py | test_rds.py | py | 6,057 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "conftest.BaseApiTest",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "mock.patch",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "stackstate_checks.base.stubs.topology.get_snapshot",
"line_number": 18,
"usage_type": "call"
},
{
... |
28665437805 | import os, glob, shutil, json, cv2, imagesize
import numpy as np
from format_processor import FormatReader
from image_processor import ImageCroper
from subprocess import call
import os, glob, shutil, json, cv2, imagesize
import utility as u
from format_processor import FormatReader
from image_processor import ImageCrop... | huylgia/bkai | mytool/detector.py | detector.py | py | 7,987 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
10254370285 | from django.urls import path, include
from .views import *
urlpatterns = [
path("", produk_list, name='produk'),
path("add_barang/", tambah_barang, name="add"),
path("update_barang/<int:id>", update_barang, name="update"),
path("delete_barang/<int:id>", delete_barang, name="delete")
]
| RenalPutra/kasir-django | produk/urls.py | urls.py | py | 304 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
33120847094 | import importlib.metadata
from argparse import Namespace
from unittest.mock import patch
import pytest
from youtube_bz.main import cli, run_command
def test_get_version(capsys): # type: ignore
with pytest.raises(SystemExit):
cli(["--version"])
captured = capsys.readouterr() # type: ignore
ass... | Flowrey/youtube-bz | tests/test_main.py | test_main.py | py | 1,010 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "youtube_bz.main.cli",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "importlib.metadata.metadata.version",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": ... |
34399272286 | '''
Purpose: Save user input, runtime, and error and print graphs depicting how error changes with user input and runtime changes with data size.
'''
import csv
import numpy as np
import matplotlib.pyplot as plt
num_layers_arr = []
num_subconnected_arr = []
num_nodes_arr = []
num_subconnected_nodes_arr = []
... | CS499-machine-learning-spring2017/DNN | src/graph.py | graph.py | py | 4,754 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.writer",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
36840649036 | from scipy.stats import pearsonr
import numpy as np
import argparse
import logging
from time import time
from auxiliary_code.file_methods import load_train_data, load_test_data, load_json, save_json
from auxiliary_code.preprocessing_steps import Preprocessing
from auxiliary_code.other_methods import pretty_print_sente... | FerranAgulloLopez/ihlt-sts | run_script.py | run_script.py | py | 6,847 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
... |
41400925272 | import pickle
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import tensorboard as tb
import pandas as pd
import json
def main():
env_name = "InvertedDoublePendulum-v2"
mbpo_available = False
mnm_available = False
threshold = 15000
factor = 10 # 10 for pendulum and 100 for... | Maionepy/DAGBNN | plot_results.py | plot_results.py | py | 6,791 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.set",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25... |
72531969789 | import asyncio
import pytest
import servicelib.aiohttp.application
from aiohttp import web
from aiohttp.test_utils import TestServer
from pytest_mock import MockerFixture
from servicelib.aiohttp.application_keys import APP_FIRE_AND_FORGET_TASKS_KEY
from servicelib.aiohttp.client_session import APP_CLIENT_SESSION_KEY, ... | ITISFoundation/osparc-simcore | packages/service-library/tests/aiohttp/test_application.py | test_application.py | py | 6,154 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "pytest_mock.MockerFixture",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "servicelib.aiohttp.application.aiohttp",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "servicelib.aiohttp.application",
"line_number": 15,
"usage_type": "... |
17874607713 | import os
import time
import traceback
from ctypes import *
import numpy
import cothread
from . import alarm
from .fields import DbfCodeToNumpy, DbrToDbfCode
from .imports import dbLoadDatabase, recGblResetAlarms
from .device_core import DeviceSupportCore, RecordLookup
from . import imports
class ProcessDeviceSupp... | allanbugyi/OPCUA_IOC | python/softioc/device.py | device.py | py | 13,170 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "device_core.DeviceSupportCore",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "device_core.RecordLookup",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "cothread.cothread._Callback",
"line_number": 86,
"usage_type": "call"
},
{
... |
5242335390 | import sys
import math
import itertools
def subst(f, n):
return sum(a*b**n for (a, b) in f)
def verify_n_equals_1(f, d, file):
if subst(f, 1) % d != 0:
raise RuntimeError()
def find_subidentity(f):
elim_exp = f[-1][1]
f_prime = [(a*(b - elim_exp), b) for (a, b) in f[:-1]]
return (elim_exp... | tuomas56/portfolio | python/exponentials/automate.py | automate.py | py | 1,869 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.stdout",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "itertools.product",
"line_number": 38,
"usage_type": "call"
}
] |
32461377391 | #!/usr/bin/python3.7
import rclpy
import time
from rclpy.node import Node
import pickle
import sklearn
from sklearn.externals import joblib
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
from std_msgs.msg import String
from std_msgs.msg import Float64MultiArray
f... | Manoj-sanagapalli/Fault-Diagnosis-for-MobileRobots | validation_node/validation/validation/validation.py | validation.py | py | 3,107 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rclpy.node.Node",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "geometry_msgs.msg.Twist",
"line_number": 32,
"usage_type": "argument"
},
{
"api_name": "std_msgs.msg.String",
"line_number": 37,
"usage_type": "argument"
},
{
"api_name": "n... |
16169443572 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
#input file voice.csv in /input/ directory inside project folder
#running this command to list
from subprocess import check_output
print(check_output(["ls", "input"]).decode("utf8"))
# In[2]:
#importing reqired libraries
import pandas as p
import numpy as n
import ... | AadityaMuley/Voice-Gender-Recognition | Voice Gender Recognition.py | Voice Gender Recognition.py | py | 6,644 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "subprocess.check_output",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 73,
"usage_type": "call"
},
{
"api_na... |
36995302448 | import pytest
from django.urls import reverse
from rest_framework import status
pytestmark = pytest.mark.django_db
class TestAuthorViewSet:
def test_get_article(self, client):
url = reverse("api:author-list")
response = client.get(url)
assert response.status_code == status.HTTP_200_OK
c... | SCOAP3/scoap3 | scoap3/authors/tests/test_author_views.py | test_author_views.py | py | 721 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pytest.mark",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.urls.reverse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_200_OK",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_na... |
38030664732 |
###############################################################
# RFM ile Müşteri Segmentasyonu (Customer Segmentation with RFM)
###############################################################
###############################################################
# İş Problemi (Business Problem)
#####################... | aydin1anil/CRM_Projects | rfm_FLO.py | rfm_FLO.py | py | 9,339 | python | tr | code | 0 | github-code | 6 | [
{
"api_name": "pandas.set_option",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
29139219436 | from functools import total_ordering
import numpy as np
import time
from multiprocessing.dummy import Pool
from tiaocan import thread_num
from board import Move
from scoring import get_more_num
class Branch:
def __init__(self, prior):
self.prior = prior
self.visit_count = 0
self.total_valu... | zty111/tonghua | agent.py | agent.py | py | 6,376 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scoring.get_more_num",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "scoring.get_more_num",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "numpy.... |
72431394747 | from urllib import request
from urllib.request import urlopen
from bs4 import BeautifulSoup
import requests
#해외축구 인기순 뉴스 url
url='https://sports.news.naver.com/wfootball/news/index?isphoto=N&type=popular'
def wfootball_headline(n): #Number of headline
html = urlopen(url).read() #Get info from url
headline_lis... | JeongYujae/Pytrader | crawling/wfootball_headline.py | wfootball_headline.py | py | 537 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
}
] |
34906191964 | import cv2
# Carga de imagen
image_path = 'av.jpg'
image = cv2.imread(image_path)
# Se guarda una copia
image_copy_path = 'copiaAV.jpg'
cv2.imwrite(image_copy_path, image)
# Se carga la copia y se convierte a escala gris
image_copy = cv2.imread(image_copy_path,0)
# Show
cv2.imshow('Original', image)
cv2.imshow('Gri... | angelmorinigo/openCVtutorial | imagen.py | imagen.py | py | 375 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 15,
... |
73816647226 |
import discord
from discord import Embed
from bot.log import get_logger
from bot.utils.messages import sub_clyde
log = get_logger(__name__)
async def send_webhook(
webhook: discord.Webhook,
content: str | None = None,
username: str | None = None,
avatar_url: str | None = None,
... | python-discord/bot | bot/utils/webhooks.py | webhooks.py | py | 864 | python | en | code | 1,206 | github-code | 6 | [
{
"api_name": "bot.log.get_logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "discord.Webhook",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "discord.Embed",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "bot.utils.messag... |
26488783838 | #!/usr/bin/env python3
import serial
import sys
import argparse
import os
import select
import cmd
import subprocess
import shlex
import base64
import zlib
import time
def default_config_dir():
xdg_config_home = os.environ.get("XDG_CONFIG_HOME")
if not xdg_config_home:
xdg_config_home = os.path.join(o... | mortie/sercom | sercom.py | sercom.py | py | 15,754 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
26516364476 | # encoding: utf-8
from setuptools import setup
import os, sys, shutil, platform
requirements = [
'pillow',
'openpyxl',
'opencv-python',
'numpy',
'pangu',
'pytesseract',
]
if platform.system() == 'Windows':
requirements.append('win10toast')
elif platform.system() == 'Darwin':
pass
lon... | airbirdx/fgo-auto-run | setup.py | setup.py | py | 774 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "platform.system",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
... |
72931172988 | # -*- coding: utf-8 -*-
"""
Created on Mon May 9 23:16:27 2022
@author: User
"""
# -*- coding: utf-8 -*-
"""
Created on Mon May 9 11:27:23 2022
@author: User
"""
import math
import pandas as pd
import numpy as np
import data_manipulation
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selec... | jpavargasf/ML_RandomForest_ANN | Joao/random_forest_default.py | random_forest_default.py | py | 4,232 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 42,... |
73591143549 | # Filename : 1kkk.py
# Date : 2018/10/29
import time
from io import BytesIO
import os
import requests
import cv2
import numpy as np
from PIL import Image
# chrome_options = webdriver.ChromeOptions()
#
# browser = webdriver.Chrome(chrome_options=chrome_options)
#
# browser.set_window_size(1200, 850)
# wait = WebDri... | gilgameshzzz/learn | day71user-agent/1kkk.py | 1kkk.py | py | 1,416 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number":... |
19606144576 | import logging
import os
import uuid
from functools import lru_cache
from graphviz import Digraph
import psqlgml.types
from psqlgml import resources
__all__ = ["draw"]
logger = logging.getLogger(__name__)
def draw(
data_dir: str,
data_file: str,
output_dir: str,
output_format: psqlgml.types.Render... | kulgan/psqlgml | src/psqlgml/visualization.py | visualization.py | py | 1,342 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "psqlgml.types.types",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "psqlgml.types",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "psqlgml.reso... |
72278314749 | import os
from sqlalchemy import *
from sqlalchemy.orm import *
from entities import *
from datetime import datetime, timedelta
from sqlalchemy_utils import database_exists, create_database
class Queries:
"""
Contains the database queries
"""
def __init__(self):
"""
Based on environme... | ciferkey/soup-bot | queries.py | queries.py | py | 3,437 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
7266232255 | from pyparsing import (delimitedList, ParseBaseException, Regex, Suppress)
from re import IGNORECASE
"""
Tools for parsing list columns on import.
"""
def ListParser():
"""
A parser for list columns, where each list is composed of pairs of values.
"""
value = Regex(r'[-+]?[0-9]+(?:\.[0-9]*)?(?:e[-+]?[0-9]+)?', ... | 0/SpanishAcquisition | spacq/interface/list_columns.py | list_columns.py | py | 701 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pyparsing.Regex",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "pyparsing.Suppress",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyparsing.Suppre... |
7876372629 | import os
import sys
import pathlib
import zipfile
from PySide2.QtWidgets import QApplication \
, QPushButton \
, QMainWindow \
, QTreeView \
, QHBoxLayout \
, QVBoxLayout \
... | e8johan/sgtskinner | sgtskinner.py | sgtskinner.py | py | 23,834 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "PySide2.QtCore.Signal",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWid... |
27720548353 | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from tabulate import tabulate
from utils import Config, do_action, RegionIdSelect, ZonesSelect
import click
from aliyunsdkecs.request.v20140526 import DescribeSpotPriceHistoryRequest
from aliyunsdkecs.request.v20140526 import DescribeRegionsRequest
fr... | glasslion/aliyun-machine-learning-for-dummies | price_history.py | price_history.py | py | 1,948 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "utils.Config",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utils.RegionIdSelect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.ZonesSelect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "aliyunsdkecs.requ... |
10420493861 | #-*- coding: utf-8 -*-
"""
.. moduleauthor:: Martí Congost <marti.congost@whads.com>
"""
import os
from time import time
from threading import Lock
from shutil import copyfileobj
from mimetypes import guess_type
from urllib.parse import unquote
import cherrypy
from json import dumps
from cocktail.memoryutils import fo... | marticongost/cocktail | cocktail/controllers/asyncupload.py | asyncupload.py | py | 3,564 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cocktail.controllers.controller.Controller",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "cocktail.memoryutils.format_bytes",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "jsonutils.json_out",
"line_number": 24,
"usage_type": "name"... |
72591235067 | from __future__ import absolute_import, unicode_literals
from vine.abstract import Thenable
from vine.funtools import (
maybe_promise, ppartial, preplace,
ready_promise, starpromise, transform, wrap,
)
from vine.promises import promise
from .case import Case, Mock
class test_wrap(Case):
def test_wrap(s... | DMills27/CMS-Django-Application | lib/python2.7/site-packages/vine-1.1.1-py2.7.egg/vine/tests/test_funtools.py | test_funtools.py | py | 2,042 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "case.Case",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "case.Mock",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "case.Mock",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "vine.funtools.wrap",
"line_number":... |
37150448269 | # standard_library.py
"""Python Essentials: The Standard Library.
Adrian Bloomer
MTH 420
April 14
"""
# Problem 1
def prob1(L):
"""Return the minimum, maximum, and average of the entries of L
(in that order, separated by a comma).
"""
return min(L), max(L), sum(L)/len(L)
print(prob1([1, 2, 3]))
# P... | bloomera/mth420-lab | StandardLibrary/standard_library.py | standard_library.py | py | 2,251 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "calculator.sqrt",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "calculator.sum",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "calculator.product",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
... |
28504158741 |
import logging
# from systemd.journal import JournaldLogHandler
import time
from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, ConversationHandler
import re
import requests
import json
api_url = "http://localhost:4444"
logging... | freelancerjava/helper_bot | helper_bot.py | helper_bot.py | py | 16,235 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG... |
16205771952 | import ast
from dataclasses import dataclass, field
from typing import Any
import xdsl.dialects.affine as affine
import xdsl.dialects.arith as arith
import xdsl.dialects.builtin as builtin
import xdsl.dialects.cf as cf
import xdsl.dialects.func as func
import xdsl.dialects.scf as scf
import xdsl.frontend.symref as sym... | xdslproject/xdsl | xdsl/frontend/code_generation.py | code_generation.py | py | 24,715 | python | en | code | 133 | github-code | 6 | [
{
"api_name": "xdsl.frontend.type_conversion.TypeConverter",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "xdsl.frontend.python_code_check.FunctionMap",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "xdsl.dialects.builtin.ModuleOp",
"line_number": 29,
... |
6001932254 | from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
import pandas as pd
def Decision_Tree_Classifier(dataPath: str):
best_epoch = 0
max_accuracy = 0
epochs = 200
heart_data = pd.read_csv(dataPath)
X = heart... | Simo1Goat/Heart-Disease-Prediction | DecisionTree.py | DecisionTree.py | py | 1,111 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 16,
"usage_type": "call"
... |
15108927136 | """
The Graph of Predicates.
"""
from __future__ import absolute_import, division, print_function
from mybuild._compat import *
from collections import namedtuple
from operator import attrgetter
from mybuild.util.collections import is_mapping
from mybuild.util.misc import Pair, bools
from mybuild.util.operator import... | abusalimov/mybuild | mybuild/req/pgraph.py | pgraph.py | py | 19,841 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "mybuild.util.misc.Pair._make",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "mybuild.util.misc.Pair",
"line_number": 98,
"usage_type": "name"
},
{
"api_name": "mybuild.util.misc.bools",
"line_number": 100,
"usage_type": "name"
},
{
"api_... |
34244209972 | import gordongames
import gym
from gordongames.envs.ggames.ai import even_line_match, cluster_match
from gordongames.envs.ggames.constants import DIRECTION2STR
from gordongames.oracles import GordonOracle
from tqdm import tqdm
import matplotlib.pyplot as plt
import time
if __name__=="__main__":
render = True
s... | grantsrb/gordongames | tests/env_test.py | env_test.py | py | 3,672 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "gym.make",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "gordongames.oracles.GordonOracle",
"... |
37682099914 | """Scaffold for signals module. Allows to choose light profile.
TODO:
Check signals module from qiskit's quantum dynamics
Everything
Need to connect with model and solver
QUESTION:
I'm thinking Signals should work just like signals qiskit, and the envelops could be on the utilities program.
Then, depending on the c... | csalasm1/Thight-Biding-Package | OneDrive - Universidad Nacional de Colombia/Documentos/FISICA_2021_01/Research Groups/Strongly correlated systems/Codes/Classes Prof Julian/Initial codes/Archive/signals.py | signals.py | py | 4,671 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"l... |
158302636 | from rest_framework import serializers
from bumblebee.buzzes.api.serializers.buzz_serializers import (
BuzzDetailSerializer,
ListBuzzImageSerializer,
)
from bumblebee.buzzes.api.serializers.interaction_serializers import (
BuzzInteractionsSerializer,
)
from bumblebee.buzzes.models import Rebuzz, RebuzzImag... | sthasam2/bumblebee-backend | bumblebee/buzzes/api/serializers/rebuzz_serializers.py | rebuzz_serializers.py | py | 5,374 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ImageField",
"line_number": 19,
"us... |
70055093629 | """
This script converts the raw XML thesaurus data to the sqlite format.
Requires xmltodict and tqdm packages.
"""
import argparse
import os
from collections import OrderedDict, defaultdict
from tqdm.auto import tqdm
import xmltodict
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from r... | avidale/python-ruwordnet | conversion.py | conversion.py | py | 9,856 | python | en | code | 46 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
18575460201 | # -*- coding: utf-8 -*-
"""
Created on Mon May 11 00:54:09 2020
@author: Niki
"""
import pandas as pd
import numpy as np
import string
import numpy.random as random
import itertools
# generate n values between 0 and the limit (max cost) with minimum 3 between each value
def gen_costs(n, limit, ga... | nicoleta-kyo/diss | train_letters_task - Copy/gen_states_functions_2.py | gen_states_functions_2.py | py | 5,044 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.hstack",
"lin... |
7491455194 | from uuid import UUID
import sqlite3
import os
from picture_chat.entities.message import Message
from picture_chat.entities.room import Room
from typing import Optional
class RoomRepository:
def get_all(self) -> list[Room]:
rooms: list[Room] = []
connection = sqlite3.connect(f"{os.path.dirname(__f... | SamuelLorrain/picture_chat | picture_chat/repositories/room_repository.py | room_repository.py | py | 1,543 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "picture_chat.entities.room.Room",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.pa... |
10281999211 | import sys
sys.path.append('./../Data/')
from KPCA import getComps
import numpy as np
X, Y = getComps(5, True)
# Splitting the dataset into the Training set and Test set
from sklearn.cross_validation import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size = 0.20, random_state = 0)
... | ChristopherMcDonald/NoShow | SVM/SVM-GridSearch.py | SVM-GridSearch.py | py | 1,422 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "KPCA.getComps",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.tra... |
11605161905 | from argparse import ArgumentParser
import cv2
import numpy as np
import os
parser = ArgumentParser()
parser.add_argument('--input_dir', type=str, help='Directory where HR images are kept.')
parser.add_argument('--output_dir', type=str, help='Directory where to output downsampled images.')
parser.add_argument('--scale... | tvanhatalo/PAM_SR | create_test_set.py | create_test_set.py | py | 906 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"li... |
27679603910 | #!/usr/bin/env python3
# these are functions for decomposition into E,U vectors from 2 or more tracks
import subprocess as subp
import numpy as np
from scipy import interpolate
from lics_unwrap import *
import dask.array as da
'''
# 2022-10-18 starts here
frame_desc = '082D_05128_030500'
frame_asc = '002A_05136_02... | comet-licsar/licsar_proc | python/decompose.py | decompose.py | py | 18,727 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "numpy.cos",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "numpy.all",
"line_number": 1... |
16498322966 | import os
import shutil
import argparse
from PIL import Image
from tqdm import tqdm
import numpy as np
from DFTR.utils import *
METRIC_DIC = {
'MAE': cal_mae,
'SM': cal_sm,
'EM': cal_em,
'FM': cal_fm,
'FMAX': cal_fmax,
'FMEAN': cal... | heqin-zhu/DFTR | codes/evaluate.py | evaluate.py | py | 6,727 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.uint8",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "numpy.concatenate",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
... |
28736553287 | from django.db import models
# Create your models here.
class libro(models.Model):
id=models.AutoField(primary_key=True)
titulo=models.CharField(max_length=100, verbose_name='Titulo')
imagen=models.ImageField(upload_to="imagenes/",null=True,blank=True,verbose_name='Imagen')
descripcion=models.... | Kayhyu/CRUD_DJANGO_PYTHON | CRUD/crud/libreria/models.py | models.py | py | 693 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.AutoField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
75070960827 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 25 11:07:03 2020
@author: rega0051
"""
from os import path
import pandas as pd
from datetime import datetime
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
pathBase = 'https://raw.githubusercontent.com/CSSEGIS... | clolsonus/covid-19 | sandbox/predict-logistic.py | predict-logistic.py | py | 5,750 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
... |
11515899585 | import operator
import attr
from pyrsistent import PClass, field
from testtools.matchers import (
Raises,
AfterPreprocessing,
MatchesAll,
IsInstance,
MatchesStructure,
Equals,
Mismatch,
)
class EqualElements(object):
"""
Match iterables for which all elements compare equal to th... | LeastAuthority/txkube | src/txkube/testing/matchers.py | matchers.py | py | 5,753 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "testtools.matchers.Mismatch",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pyrsistent.PClass",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "pyrsistent.field",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "operat... |
75226499068 | from flask import Flask, jsonify, request
import openai
import os
app = Flask(__name__)
openai.api_key = "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"
model_engine = "text-davinci-003"
def remove_special_characters(str):
return str.replace("[^\w\s#]", '')
@app.route('/model-output', method... | Prashanth7115/test1 | test/main.py | main.py | py | 1,691 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "flask.request.json",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.request",... |
12993414412 | import sys
import os
# path = os.path.join(os.path.dirname(__file__), os.pardir)
fwd = os.path.dirname(__file__)
sys.path.append(os.getcwd())
import pandas as pd
import matplotlib.pyplot as plt
from source.utils import check_for_dir_and_create
import seaborn as sns
from ast import literal_eval
sns.set_context("paper",... | efkag/ant_world_alg_bench | Results/newant/route-perf-error-analysis.py | route-perf-error-analysis.py | py | 3,532 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number... |
26668715315 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Start to build final NLP prediction model
@author: joshmagee
Tue Sep 18 15:00:42 2018
"""
import wine
import dill
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from nltk.corpus import stopwords
sns.set_palette("dark")
... | joshmagee/Insight-DS | Wine/nlp_model.py | nlp_model.py | py | 9,649 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.set_palette",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "wine.read_wine",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "wine.clean_data",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "wine.select_top10"... |
33108556416 | import urllib.request
from bs4 import BeautifulSoup
import os
class Scraper:
def __init__(self, site):
self.site = site
def scrape(self):
r = urllib.request.urlopen(self.site)
html = r.read()
parser = "html.parser"
articles = []
sp = BeautifulSoup(html, parser... | Rutrle/The-Self-Taught-Programmer-by-Althoff | chapter_20/ch_20_challenge_1.py | ch_20_challenge_1.py | py | 847 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 12,
"usage_type": "name"
},
{
"api_nam... |
72370680507 | from rest_framework.serializers import ModelSerializer
from brands.models import Brand
from users.serializers import UserSerializer
from products.serializers import ProductDetailSerializer
from sites.serializers import SiteDetailSerializer
class BrandSerializer(ModelSerializer):
user = UserSerializer(read_only=T... | ohnas/Manager-backend | brands/serializers.py | serializers.py | py | 910 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "users.serializers.UserSerializer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "brands.models.Brand",
"line_number": 13,
"usage_type": "name"
... |
15886993567 | #
# Abstract class
# Head of schedule controller hierarchy
#
# Created by Samuel Dufresne on 2018-04-13
#
from abc import ABCMeta, abstractmethod
from firebase import firebase as firebase
import config as conf
import math
class ScheduleModel(object):
__metaclass__ = ABCMeta
def __init__(self):
self.... | Calvibert/workout-generator | scheduler/schedule.py | schedule.py | py | 3,358 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "abc.ABCMeta",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "firebase.firebase.FirebaseApplication",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "firebase.firebase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "c... |
12658130123 | # -*- coding: utf-8 -*-
import requests
import pandas as pd
import datetime
import csv
import re
from bs4 import BeautifulSoup
class HTMLTableParser:
def parse_url(self, url):
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
return [(table['id'],self.pa... | andrew-noh/cmc-coins-to-csv | coinmarketcap.py | coinmarketcap.py | py | 3,343 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_nu... |
13206725918 | from apps.weather.models import Weather, City
import random
from django.db import connection
with connection.cursor() as cursor:
copy_sql = """
COPY weather_weather (formatted_date, summary, precip_type, temperature_c, apparent_temperature_c, humity, wind_speed, wind_bearing, visibility, loud_cover, pressure,... | EdynDev/django-enhanced | django_enhanced/script.py | script.py | py | 729 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.connection.cursor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.db.connection",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "apps.weather.models.City.objects.all",
"line_number": 15,
"usage_type": "call"
},
{
... |
19958550713 | from sqlalchemy import create_engine, MetaData, select
from faker import Faker
import sys
import random
import datetime
import configparser
from connect import engine
engine = engine
metadata = MetaData()
metadata.reflect(bind=engine)
# Instantiate faker object
faker = Faker()
utilisateur = metadata.tables["utilisat... | thompson290000/bdd-SUJET-6 | populate_tablesS6.py | populate_tablesS6.py | py | 3,531 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "connect.engine",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "connect.engine",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "faker.Faker",
"l... |
23396806452 | from math import ceil
from heapq import heapify, heappop
from util import timeit, merge, flat_map
from ADT import BST
from itertools import accumulate
from collections import Counter
RUN_SIZE = 2**6
@timeit
def quick_sort(array :list)->list:
def _quick_sort(array :list)->list:
if len(array)<=1: return ar... | paulnegz/sorts-py | sort.py | sort.py | py | 4,426 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "util.timeit",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "util.merge",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "util.timeit",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "math.ceil",
"line_number": 37,... |
7305124158 | import os
import pickle
from sklearn.preprocessing import OneHotEncoder
import config
import dataset
import engine
import torch, torch.nn as nn, torch.utils.data, torch.optim as optim
import numpy as np
from model import BERTBaseUncased
from sklearn import metrics
from transformers import get_linear_schedule_... | alvynabranches/jayatu_assignment | src/train.py | train.py | py | 3,512 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.empty_cache",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.... |
71968724027 | """
Author: gystar
Date: 2020-12-14 10:59:54
LastEditors: gystar
LastEditTime: 2020-12-14 10:59:54
FilePath: /ml_hws/hw7/model_distillation.py
Description: 使用小模型去学习大的模型
"""
import torch
import multiprocessing
import numpy as np
import datetime
import math
#小(旧)Model: teacher_model,想要得到的新Model:student_model,就是使用旧的model... | gystar/ml_hws | hw7/model_distillation.py | model_distillation.py | py | 3,469 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.utils",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 21,
"usage_type": "call"
},
{
"api_name":... |
43431243184 | import logging
import zipfile
import os
import shutil
import pprint
from core.analyzer.apk_parser import APKParser
from core.analyzer.analyzer import androguard_analyze_apk
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
level=... | CMUChimpsLab/playstore-scraper | plugins/apk_experiments/strings_test.py | strings_test.py | py | 3,333 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pprint.Pretty... |
15653065834 | import requests
import fake_useragent
import random
from bs4 import BeautifulSoup as BS
def get_html(html, rnd):
global r
r = requests.get(f'{html}{rnd}').text
print(f'{html}{rnd}')
def parse(obj, rnd):
try:
soup = BS(r, 'lxml')
block = soup.find('div', class_ = obj)
img = block.find('img').get('src')
... | sarenis/tg_parsing_bot | parser.py | parser.py | py | 489 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
}
] |
30685509331 | import unittest
from datetime import datetime
from unittest.mock import ANY
import orjson
from freezegun import freeze_time
from aiologger.formatters.json import JsonFormatter
from aiologger.records import LogRecord
from aiologger.utils import CallableWrapper
class JsonFormatterTests(unittest.TestCase):
def set... | async-worker/aiologger | tests/formatters/json/test_json_formatter.py | test_json_formatter.py | py | 6,205 | python | en | code | 114 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "aiologger.records.LogRecord",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "aiologger.formatters.json.JsonFormatter",
"line_number": 25,
"usage_type": "call"
},... |
16713353427 | #!/usr/bin/env python
# coding: utf-8
from sklearn.datasets import load_files
from keras.utils import np_utils
import numpy as np
from glob import glob
from torchvision import models
from torchvision import transforms
from torch import nn
from torch.utils.data import Dataset
from PIL import Image
from torchvi... | regarmukesh3g/DogBreedClassifier | dog_app.py | dog_app.py | py | 7,963 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.load_files",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.utils.np_utils.to_categorical",
"line_number": 20,
"usage_type": "call"
},
{
"api_n... |
21746324602 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="zendesk_exporter",
version="0.0.31",
author="Mark Halonen",
author_email="halonen.mark@gmail.com",
description="A small zendesk export tool",
long_description=long_description,
lon... | markhalonen/zendesk_exporter | setup.py | setup.py | py | 815 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
40169959753 | from django.db import models
# Create your models here.
class User(models.Model):
"""Modelo de usuario para un CRUD simple.
"""
id = models.AutoField(primary_key=True)
nombre = models.CharField(max_length=60, blank=False)
apellido = models.CharField(max_length=100, blank=False)
email = models.... | acuellodemoya/crud_django | usuarios/models.py | models.py | py | 429 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.AutoField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
31987332252 | import configparser
import os
# Создание файла конфигурации
def create_config(path):
config = configparser.ConfigParser()
config.add_section("Settings")
config.set("Settings", "auto_on", "True")
config.set("Settings", "max_room01_temp", "23")
config.set("Settings", "heater_on", "False")
confi... | Uzov/homemqttproject | settings.py | settings.py | py | 2,167 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "configparser.Con... |
16783051445 | import logging
import os
import argparse
import torch
import random
import gc
import optuna
import pandas as pd
import numpy as np
from utils import map3, compute_metrics, set_seed
from tqdm import tqdm
from config4 import CFG4
from datasets import Dataset
from model import AWP, CustomModel
from collections import Orde... | zdhdream/LLM-Science-Exam | tran4.py | tran4.py | py | 15,612 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "config4.CFG4.is_settingParameters1",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "config4.CFG4",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "model.named_parameters",
"line_number": 35,
"usage_type": "call"
},
{
"api_n... |
43119655107 | import cv2
import os
if not os.path.exists('./output'):
os.makedirs('./output')
for root, dirs, files in os.walk("./images"):
for file in files:
aa = (root + '\\' + file)
bk_img = cv2.imread(aa)
cv2.putText(bk_img, file[:-4], (300, 60), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 1, cv2.... | lengyuedong/spider | sb.py | sb.py | py | 402 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 7,
... |
34464458989 | from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from dateutil import parser
from django.conf import settings
class EndlessPagination(BasePagination):
page_size = 20 if not settings.TESTING else 10
def __init__(self):
super(EndlessPagination, self).__i... | wangxiaoyu-au/django-twitter | utils/paginations.py | paginations.py | py | 3,345 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.pagination.BasePagination",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.TESTING",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 8,
"usage_type": "name"
... |
32765199507 | # Source: https://github.com/shantnu/FaceDetect; modeled after this use case
import cv2
import sys
import time
class tv_watcher:
"""
This is a class that will 'watch' the TV stream, take a screen shot every so often (~1/sec); as
different screens are captured, a face-detection algorithm will be run a... | osulluke/eigenface-production | Flask_UI/lib/tv_watcher.py | tv_watcher.py | py | 5,865 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.data",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "cv2.data",
... |
72162614269 | import os,cv2
from collections import Counter
root = '/home/yao/Documents/hypersim/floor'
savePath = '/home/yao/Documents/hypersim/resize/labels'
for img in os.listdir(root):
imfile = os.path.join(root,img)
im_ = cv2.imread(imfile,cv2.IMREAD_GRAYSCALE)
im = cv2.resize(im_,(640,480),cv2.INTER_NEAREST)
te... | Yaoxingtian/DDRNet | 002.py | 002.py | py | 553 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 7,
... |
24487015070 | # Создайте FileSensor, который будет проверять присутствие файла /data/test.txt в локальной папке.
# Чтобы сделать FileSensor, напишите новый DAG из трёх шагов:
# Start — начало процесса, пустой шаг-заглушка;
# Сенсор FileSensor, который проверяет наличие файла test.txt в локальной папке;
# Finish — окончание процесса,... | Artem-ne-Artem/Data-engineering-by-Yandex-Practicum | s4-lessons/4.3.3.1.py | 4.3.3.1.py | py | 1,159 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "airflow.models.DAG",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "airflow.sensors.filesystem.FileSensor",
"line_number": 22,
"usage_type": "call"
}
] |
38932113277 | # coding=utf-8
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""`ReduceManager` finds the smallest testcase(s) to reproduce an issue."""
from itertools import chain
im... | jschwartzentruber/grizzly | grizzly/reduce/core.py | core.py | py | 33,590 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "target.relaunch",
"line_number": 114,
"usage_type": "attribute"
},
{
"api_name": "stats.Reduction... |
1398475964 | from django.db import migrations, models
class Migration(migrations.Migration):
""" Defines the database migration for altering the amount of points a user
has.
"""
dependencies = [
('loginApp', '0002_alter_user_username'),
]
operations = [
migrations.AlterField(
m... | jjandrew/GroupEngineeringProjectGroup4 | technical-documents/source-code/loginApp/migrations/0003_alter_user_points.py | 0003_alter_user_points.py | py | 431 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 13,
"usage_type": "call"
},
{... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.