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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21819456573 | import timeit
import argparse
import gc
import re
import pandas as pd
import pyarrow as pa
import pyfletcher as pf
# Add pyre2 to the Python 3 compatibility wall of shame
__builtins__.basestring = str
import re2
import re2_arrow
class Timer:
def __init__(self, gc_disable=True):
self.starttime = 0
... | abs-tudelft/fletcher-example-regexp | software/python/regexp.py | regexp.py | py | 13,726 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "gc.disable",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "gc.enable",
... |
73028371253 | import json
from .utils import product
def get_shapes(table, ctx):
vars = (
ctx.input_arrays.keys()
+ ctx.output_arrays.keys()
+ ctx.intermediate_arrays.keys()
+ ctx.const_arrays.keys())
return {v:table.vars[v].shape for v in vars}
def get_offsets(ctx, shapes):
offsets =... | LiuFang816/SALSTM_py_data | python/bhuztez_lift/lift-master/lift/asmjs_formatter.py | asmjs_formatter.py | py | 9,825 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "utils.product",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.product",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "utils.product",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "utils.product",
"line_n... |
6342455584 | from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F
app = FastAPI()
# Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
token_emb... | engageintellect/AI-ML | huggingface/tasks/sentance-transformers/create-embeddings/api/main.py | main.py | py | 1,632 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.clamp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer.from_... |
25522806475 | from flask import current_app
from rdkit import Chem
from chem_iupac.model.concern.verify import verify_by_opsin
class IupacModel:
@classmethod
def __canonize_sort(cls, smi_strs):
csmi_strs = []
for smi_str in smi_strs:
sort_csmi_str = ''
try: # canonize & sort
... | JasonYCHuang/chem-dl-iupac | chem_iupac/model/iupac_model.py | iupac_model.py | py | 1,529 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "rdkit.Chem.MolToSmiles",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "rdkit.Chem.MolFromSmiles",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.curr... |
72534466934 | import pyqrcode
import requests
import requests.utils
import os
import time
import subprocess
import json
import csv
import sys
from datetime import datetime
from lxml import etree
requests.packages.urllib3.disable_warnings()
#主文件夹
BASEDIR = os.path.dirname(os.path.realpath( sys.argv[0]))
class Dynamic:
CONFIG... | Vita-314/AutoDownBUPDynamic | Dynamic.py | Dynamic.py | py | 13,788 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
... |
21677268551 | import pickle
import json
import os
import logging
import pandas as pd
from sklearn import metrics
import matplotlib.pyplot as plt
import seaborn as sns
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(message)s")
logger = logging.getLogger()
with open("config.json", "r") as f:
confi... | juanmillan85/dynamic-risk-assessment-system-udacity-course | reporting.py | reporting.py | py | 1,973 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.load",
... |
31136317220 | import torch
import torchvision.transforms as transforms
from PIL import Image # If working with image data
import torch
import torch.nn as nn
# Define an ANN model
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.fc1 = nn.Linear(3 * 32 * 32, 512)
self.fc2 = nn.Li... | Yukesh432/pytorch-learning | CNN/inference.py | inference.py | py | 1,963 | python | en | code | 0 | github-code | 21 | [
{
"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": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
41858200000 | #!/usr/bin/env python3
import argparse
from collections import defaultdict
import os
import pickle
import numpy as np
from scipy import spatial
"""Dictionary of atomic numbers."""
all_atoms = ['H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne',
'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca'... | masashitsubaki/QuantumDeepField_molecule | train/preprocess.py | preprocess.py | py | 8,466 | python | en | code | 175 | github-code | 21 | [
{
"api_name": "numpy.arange",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number":... |
8179663543 | from collections import Mapping
from os.path import join
import logging
from git import Repo, exc as git_exc
from gtd.io import IntegerDirectories, Workspace
from gtd.log import SyncedMetadata
from gtd.utils import Config, cached_property
class ExperimentWorkspace(Workspace):
def __init__(self, root):
s... | microsoft/ContextualSP | lemon/executor/gtd/ml/experiment.py | experiment.py | py | 5,256 | python | en | code | 348 | github-code | 21 | [
{
"api_name": "gtd.io.Workspace",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "gtd.log.SyncedMetadata",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "gtd.utils.cached_property",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "git... |
222926073 | from bond import Bond
from curve import Curve
from datetime import date
from dateutil.relativedelta import relativedelta
import utilities
class YieldCalculator():
''' collection of static method calculate yields for the given bond, price and value date
'''
@staticmethod
def get_clean_price_from_yield(b... | leavedream/bond_model | yieldcalculator.py | yieldcalculator.py | py | 4,269 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bond.Bond",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "bond.Maturity",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "bond._get_next_date_idx",
... |
7499744523 | class SyncCursor:
def __init__(self, _host='localhost', _user='root', _password='qwe123!!@@', _db='menu', _charset='utf8'):
try:
import pymysql
self.conn = pymysql.connect(host=_host, user=_user, password=_password, db=_db, charset=_charset)
self.cur = self.conn.cursor()... | lazylee-l2i/OpenKiosk | Sync.py | Sync.py | py | 3,619 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymysql.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number... |
23088792251 |
from asyncio.windows_events import NULL
import email
from hashlib import new
from logging.config import listen
from multiprocessing import context
from re import X
from django.shortcuts import get_object_or_404, render,redirect
from django.urls import reverse
from .models import category,blog,author,aboutt,comment, or... | ilkerturan38/blogProjectDjango | blogPro/blogapp/views.py | views.py | py | 19,664 | python | tr | code | 0 | github-code | 21 | [
{
"api_name": "models.blog.objects.select_related",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.blog.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "models.blog",
"line_number": 21,
"usage_type": "name"
},
{
"api_name"... |
24250759192 | import torch
import torch.nn.init as init
import autodiff.functional as F
import autodiff.modules as nn
import torch.nn.functional as TF
import itertools
# Original TRPO uses 2 hidden layers with width 64
# normc is initialization procedure from open AI baselines
def normc_initializer(param,std=1.0, axis=-1):
with... | ceisenach/torchkit | model.py | model.py | py | 5,726 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "torch.no_grad",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "autodiff.modules.Module",
"l... |
34118674664 | import sys
from functools import reduce
def gcd(a,b):
while b:
a,b = b,a%b
return a
def main():
if len(sys.argv) < 3:
print("Usage: py ex1.py num1 num2 [num3 ...]")
sys.exit(1)
numere = [int(x) for x in sys.argv[1:]]
print("Cel mai mare divizor al numerelor",numere... | cezar06/Python | lab1/ex1.py | ex1.py | py | 388 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "functools.reduce",
"line_numb... |
36365997412 | import os
import serial
device = os.open('/dev/ttyUSB0', os.O_RDWR|os.O_NOCTTY)
serial = serial.Serial('/dev/ttyUSB0', 19200, timeout=1)
os.write(device, b'\xFB')
while True:
tag = serial.read(size=12)
tag = bytearray(tag).hex()
print(tag)
| R3B3-888/www | ASPIC/UE-MMSE/01-rfids/lecture-tag/lecture_tag.py | lecture_tag.py | py | 254 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.open",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.O_RDWR",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.O_NOCTTY",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "serial.Serial",
"line_number... |
25395833090 | """Demo script for the REST API.
Logs in using demo credentials, get the projects, clients and users metadata
and print them on screen.
"""
import requests
import json
from typing import Dict
base_url = 'https://api.cloud.rtloc.com'
def login(user_credentials: Dict[str, str]) -> Dict:
"""Logs in the API's /auth/l... | RT-LOC/API-examples | parsers/REST/Python/demo.py | demo.py | py | 3,426 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number... |
37235222408 | import pandas as pd
from utils import ColumnNames
from predictors import Strategy
if __name__ == '__main__':
main_set = pd.read_csv("data/MA.csv", index_col=0)
column_names = ColumnNames(
open_str="Open",
close_str="Close",
low_str="Low",
high_str="High",
adj_close_str=... | sikrinick/naive_bayes_trend_prediction | main.py | main.py | py | 741 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.ColumnNames",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "predictors.Strategy",
"line_number": 21,
"usage_type": "call"
}
] |
71172368372 |
import os
import json
import sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
import numpy as np
import torch
from torch.utils.data import TensorDataset, DataLoader, SubsetRandomSampler
from utils.data import NERData
from itertools import product
from transformers import BertTokenizer,... | KIST-CSRC/CO2RR_NER | BERT_CRF/models/base_ner_model.py | base_ner_model.py | py | 24,802 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
74173876852 | import logging
from pprint import pprint
import boto3
from botocore.exceptions import ClientError
import requests
from googletrans import Translator
from rekognition_objects import (
RekognitionFace, RekognitionCelebrity, RekognitionLabel,
RekognitionModerationLabel, RekognitionText, show_bounding_boxes, show... | dahermar/TMI_Project | rekognition/pruebas.py | pruebas.py | py | 10,039 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rekognition_objects.RekognitionFace",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 85,
"usage_type": "name"
},
{
... |
3906136031 | import json
import argparse
from s3helper import get_connection_response, get_all_buckets
parser = argparse.ArgumentParser(description='get all bucket names')
parser.add_argument('--access_key_id', required=True, type=str, help='AWS access key id')
parser.add_argument('--secret_access_key', required=True, type=str, h... | jaehyeon-kim/rs3helper | inst/python/get_all_buckets.py | get_all_buckets.py | py | 823 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "s3helper.get_connection_response",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "s3helper.get_all_buckets",
"line_number": 15,
"usage_type": "call"
},
{
"... |
43972497057 | from datetime import datetime, timedelta
import os
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators import (StageToRedshiftOperator, LoadFactOperator,
LoadDimensionOperator, DataQualityOperator, CreateTablesOperator)
from helpers i... | bdnf/BigData-Engineering-Projects | AirflowDataPipeline/dags/udac_example_dag.py | udac_example_dag.py | py | 4,504 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "airflow.operators.du... |
3652619582 | import numpy as np
from tqdm import tqdm
from sklearn.cluster import KMeans
with open('hw4_nolabel_train.dat', 'r') as f:
train_data = np.array([ list(map(float, line.strip().split(' '))) for line in f.readlines()])
inertia = []
for t in tqdm(range(100)):
kmeans2 = KMeans(n_clusters=2).fit(train_data)
ine... | maclin726/MachineLearningTechniques2020spring | coursera_hw4/kmeans.py | kmeans.py | py | 671 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_numb... |
21490036576 | import numpy as np
import pickle
import cv2
import ipdb
select_label = 0
with open('/mnt/data1/yjzhu/ntu_preproc_keypoint/raw_data', 'rb') as f:
raw = pickle.load(f)
data = raw['data']
class1_data = []
for idx, label in enumerate(raw['labels']):
# only select class label = 0
if label == select_label:
... | yjzhux/pose_rnn | data/get_1class_data.py | get_1class_data.py | py | 868 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 31... |
2968969532 | import operator
import django_filters
from functools import reduce
from django.conf import settings
from django.db.models import DecimalField
from django.db.models.expressions import Value
DEFAULT_SEARCH_RESULT_SIZE = 2500
class SearchFilter(django_filters.Filter):
def strip_tsquery_syntax(self, query_terms):... | Nyto035/autolink-api | bina_bikers/pg_search/filters.py | filters.py | py | 8,089 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django_filters.Filter",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.db.models.expressions.Value",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "django.db.models.DecimalField",
"line_number": 141,
"usage_type": "call"
... |
74440933493 | import arcpy, math, statistics
import getElevation
arcpy.env.overwriteOutput = True
def calcSlope(lineLayer):
'''
Finkcja do oblicznia spadku obiektów w warstwie liniowej
:return:
'''
i=0
with arcpy.da.UpdateCursor(lineLayer, ['SPADEK', 'Shape_Length', 'SHAPE@']) as update:
for row in u... | MariuszGasior04/SKRYPTY_PYTHON | WWF_tools/utracone_siedliska_rzeczne.py | utracone_siedliska_rzeczne.py | py | 8,782 | python | pl | code | 0 | github-code | 21 | [
{
"api_name": "arcpy.env",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "arcpy.da.UpdateCursor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "arcpy.da",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "getElevation.getPoi... |
31131246570 | """
a dnn model written by numpy & pandas
tian yan
uestc
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
plt.rcParams['lines.linewidth'] = 2
global layer_number
def init_data(train_set_from_excel, test... | yoshigake/Demo | dnn_numpy.py | dnn_numpy.py | py | 9,859 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
22316950469 | #!/usr/bin/env python3
import re
import itertools
def apply_gravity(moons):
for m1, m2 in itertools.combinations(moons, 2):
pos1, vel1 = moons[m1]
pos2, vel2 = moons[m2]
for i in range(3):
dv = (pos1[i] - pos2[i]) // max(abs(pos1[i] - pos2[i]), 1)
vel1[i] -= dv
... | tomhel/AoC | 2019/day12/1.py | 1.py | py | 883 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "itertools.combinations",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 34,
"usage_type": "call"
}
] |
3130907531 | import importlib
import sys
d = {}
for module in ['kafka', 'msgpack', 'scipy', 'numpy']:
try:
d[module] = importlib.import_module(module)
except ModuleNotFoundError:
print(f'''Module {module} is not installed. Run "pip install {module if module != 'kafka' else 'kafka-python'}"''')
sys.ex... | DUNE-DAQ/dqm | python/dqm/import_checks.py | import_checks.py | py | 405 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "importlib.import_module",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 9,
"usage_type": "call"
}
] |
73031297013 | import hashlib
import numpy as np
import h5py
from ..database import db
class BrainData(object):
def __init__(self, data, subject, **kwargs):
if isinstance(data, str):
import nibabel
nib = nibabel.load(data)
data = nib.get_data().T
self._data = data
try:... | LiuFang816/SALSTM_py_data | python/gallantlab_pycortex/pycortex-master/cortex/dataset/braindata.py | braindata.py | py | 14,201 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "nibabel.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "h5py.Dataset",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.nan_to_num",
"line... |
41799130386 | import logging
import random
import time
from typing import List, Optional, cast
from srl.base.rl.base import RLParameter, RLRemoteMemory
from srl.runner.callback import Callback, TrainerCallback
from srl.runner.runner import Runner
from srl.utils import common
logger = logging.getLogger(__name__)
def play(runner: ... | pocokhc/simple_distributed_rl | srl/runner/core.py | core.py | py | 8,013 | python | en | code | 25 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "srl.runner.runner.Runner",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "srl.base.rl.base.RLParameter",
"line_number": 14,
"usage_type": "name"
},
{
"api_name"... |
36050390387 | from abc import ABC, abstractmethod
from math import inf
from typing import Callable
from agent.agent import Agent
from valuereps.value_representation import ValueRepresentation
from utils.type_aliases import TypeLearnResult, TypeAction, TypeValidState, is_valid_state_tg
import utils.constants as constants # pylint:... | mmakipaa/rl | methods/method.py | method.py | py | 2,581 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "abc.ABC",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "agent.agent.Agent",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "valuereps.value_representation.ValueRepresentation",
"line_number": 14,
"usage_type": "name"
},
{
"api_... |
70505946932 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 12 14:45:19 2020
@author: Ben
"""
import numpy as np
import matplotlib.pyplot as plt
import pdf_routines as pdf
import lmfit
def fftnoise(f):
f = np.array(f, dtype='complex')
Np = (len(f) - 1) // 2
phases = np.random.rand(Np) * 2 * np.pi
phases = np.cos(... | RimbergLab-Dartmouth/Python-codebase | Ben_code/theory/white_noise/generate_band_limited_white_noise.py | generate_band_limited_white_noise.py | py | 1,598 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_... |
40543083212 | import logging
from http import HTTPStatus
from typing import Any, Dict
from flask import make_response
from flask_security import auth_token_required, roles_accepted
from monkeytypes import AgentPluginManifest, AgentPluginType
from common.agent_plugins import PluginName
from monkey_island.cc.flask_utils import Abstr... | guardicore/monkey | monkey/monkey_island/cc/services/agent_plugin_service/flask_resources/installed_agent_plugins_manifests.py | installed_agent_plugins_manifests.py | py | 1,807 | python | en | code | 6,367 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "monkey_island.cc.flask_utils.AbstractResource",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "flask.make_response",
"line_number": 36,
"usage_type": "call"
},
{
... |
3464728467 | import gi
try:
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
gi.require_version('Gio', '2.0')
gi.require_version('GLib', '2.0')
gi.require_version('GObject', '2.0')
gi.require_version('Handy', '0.0')
except Exception as e:
print(e)
exit(1)
from gi.repository import Gt... | atareao/ubuntu-first-steps | src/mainwindow.py | mainwindow.py | py | 10,570 | python | en | code | 38 | github-code | 21 | [
{
"api_name": "gi.require_version",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "gi.require_version",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "gi.require_version",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "gi.require_vers... |
41743632902 | import pandas as pd
import random
from itertools import islice
from utils.RandomDataGenerator import getrandxy
from utils.RandomDataGenerator import Data
def chunkify(it, size):
it = iter(it)
return [*map(lambda x: list(x), iter(lambda: tuple(islice(it, size)), ()))]
"""
Dataloader is an important part of ma... | keshavsbhandari/CS4347 | assignment1_regression/utils/DataLoader.py | DataLoader.py | py | 3,215 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "itertools.islice",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "utils.RandomDataGenerator.getrandxy",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "... |
13525395626 | # -*- coding: utf-8 -*-
import pandas as pd
import sys
from utils import find_zipcode, euro2float, str2date
from builtins import str as text
header_mapping = {
'ORIGIN': 'ORIGIN',
'LABO': 'LABO',
'QUALITE_NOM_PRENOM': 'BENEF_PS_QUALITE_NOM_PRENOM',
'ADRESSE': 'BENEF_PS_ADR',
'QUALIFICATION': 'BENE... | regardscitoyens/sunshine-data | scripts/format_infirmiers.py | format_infirmiers.py | py | 1,482 | python | en | code | 11 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "utils.euro2float",
"l... |
11381487230 |
from sqlite3 import OperationalError
from dependencies import *
import sqlite3
from datetime import datetime
import pandas as pd
from tel_bot import TelegramBot, BotSend
# connects to DB and gets the time
con = sqlite3.connect("subscription.db")
cur = con.cursor()
today_date = datetime.today().date()
# menu
def men... | nikthe883/Telegram-bot-with-database | main.py | main.py | py | 19,321 | python | bg | code | 2 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.da... |
30475053348 | # filter user.json for elite yelp users' info (in get_elite_info.json)
import json
"""
this function
- removes the elite user's name,
- converts the list of friends into the number of friends,
- converts compliments into a more usable dictionary
"""
def formatElite(eliteUser):
tempDict = {}
t... | rahrang/yelp-dataset-project | src/scripts/get_elite_info.py | get_elite_info.py | py | 2,045 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 54,
"usage_type": "call"
}
] |
36963500127 | from datetime import datetime, timedelta
from twisted.trial import unittest
from twisted.internet.defer import inlineCallbacks
import txmongo
from kuriosus.messages import MessageHandler
from kuriosus import settings
class BaseTestCase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
self.repl... | igorsobreira/kuriosus | tests/test_message_handler.py | test_message_handler.py | py | 7,437 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "twisted.trial.unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "twisted.trial.unittest",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "txmongo.MongoConnection",
"line_number": 16,
"usage_type": "call"
},
{
... |
7124667056 | import collections
import dbm
import json
import os
import tempfile
import MySQLdb as mysql
from MySQLdb.constants import FIELD_TYPE
from openstack import connection as os_conn
from openstack import exceptions as os_exp
OS_AUTH_ARGS = {
'auth_url': '{{ keystone_service_internalurl }}',
'project_name': '{{ k... | ppetit/openstack-ansible-mon | cluster_metrics/templates/telegraf-plugins/ironic_nodes.py | ironic_nodes.py | py | 5,217 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "MySQLdb.connect",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "MySQLdb.constants.FIE... |
70872116854 | import pytest
from manager.backend.user_manager.token_manager import MgmtTokenManager
from manager.backend.user_manager.session import Session
pytestmark = pytest.mark.unit
def test_encode_decode_jwt_token():
"""Test By encoding & decoding JWT."""
jwt_manager = MgmtTokenManager()
user_name = 'ABC',
... | Seagate/cortx-halo | manager/backend/test/unit/test_token_encode_decode.py | test_token_encode_decode.py | py | 1,246 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pytest.mark",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "manager.backend.user_manager.token_manager.MgmtTokenManager",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "manager.backend.user_manager.token_manager.MgmtTokenManager.create_to... |
73960917492 | from dataclasses import dataclass
from datetime import timedelta
from os import listdir
from typing import Optional
from time import strptime
from .types import History, PlayList
@dataclass
class _MyLibrary:
liked_songs: list
liked_albums: list
liked_shows: list
liked_episodes: list
following_ar... | akioweh/statipy | filemgr/data.py | data.py | py | 2,528 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "types.History",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "types.PlayList",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
41734260856 | #!/usr/bin/python3
import json
from lxml import html
import requests
def generURL(a):
url = 'http://www.dxcontent.com/SDB_SpellBlock.asp?SDBID='+str(a)
return url
data=[]
for i in range(1,1972):
#On évite les deux pages qui posent problème dans le site web. La page 1841 est une page vide,
#la page 1... | kwidz/BigDataDungeonsAndDragons | parser.py | parser.py | py | 2,097 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "json.dump",
"line_num... |
74015681014 | # Mapping Nonlinear to Linear
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
x=np.random.uniform(low=10, high=35, size=(200,)) + np.random.normal(loc=2, scale=0.5, size=200)
y = np.sqrt(400 - (x-20)**2)+ np.random.normal(loc=20, scale=0.5, size=200)
#plt.scatter(x,y,color=['red','green'])
plt.fi... | jmajumde/jm_ds_ml | ml/AdvancedRegression/myAdvancedRegression.py | myAdvancedRegression.py | py | 636 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.uniform",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
... |
36993208577 | import requests
import pandas as pd
from bs4 import BeautifulSoup
page = requests.get(
'https://forecast.weather.gov/MapClick.php?lat=34.05349000000007&lon=-118.24531999999999#.Xf-S30cvOUk')
soup = BeautifulSoup(page.content, 'html.parser')
week = soup.find(id='seven-day-forecast')
items = week.find_all(class_=... | YeasirArafatRatul/web_scraping | weather_data_scraping.py | weather_data_scraping.py | py | 2,306 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 45,
"usage_type": "call"
}
] |
25519960456 | # vim:shiftwidth=2:tabstop=2:expandtab:textwidth=80:softtabstop=2:ai:
from __future__ import print_function
import json
import os
from libpius.constants import PIUS_HOME
class SignState(object):
kSIGNED = 'SIGNED'
kWILL_NOT_SIGN = 'WILL_NOT_SIGN'
kNOT_SIGNED = 'NOT_SIGNED'
kPIUS_SIGNED_KEYS = os.path.join(... | lechner/pius | libpius/state.py | state.py | py | 2,119 | python | en | code | null | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "libpius.constants.PIUS_HOME",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.exi... |
18589315251 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astropy.time`.
"""
use_fast_parser = _config.ConfigItem(
["True", "False", "force"],
"Use fast C parser for supp... | astropy/astropy | astropy/time/__init__.py | __init__.py | py | 1,710 | python | en | code | 4,015 | github-code | 21 | [
{
"api_name": "astropy.config.ConfigNamespace",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "astropy.config",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "astropy.config.ConfigItem",
"line_number": 10,
"usage_type": "call"
},
{
"api_na... |
71081136692 | from rest_framework import serializers
from contacts.models import Contact
class ContactSerializer(serializers.ModelSerializer):
class Meta:
model = Contact
fields = ('id', 'name', 'number')
# validation for duplicate name
def validate_name(self, given_name):
name_matched = Co... | umilton/technical-task | contacts/api/serializers.py | serializers.py | py | 1,060 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "contacts.models.Contact",
"line_number": 7,
"usage_type": "name"... |
25810657905 | from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QHBoxLayout, QLabel, QLineEdit, QMessageBox, QWidget
# core is main enki.core singletone. It is usually used for getting pointers to other singletones
from enki.core.core import core
import enki.widgets.dockwidget
__pluginname__ = ... | andreikop/enki | enki/example-plugin/helloworld.py | helloworld.py | py | 4,571 | python | en | code | 161 | github-code | 21 | [
{
"api_name": "enki.core.core.widgets",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "enki.core.core",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "enki.core.core.widgets.dockwidget.DockWidget.__init__",
"line_number": 17,
"usage_type": "call... |
9073480595 | import logging
from collections import OrderedDict
import numpy as np
from pandas import DataFrame
from typing import List
from ConfigSpace.configuration_space import Configuration
from smac.runhistory.runhistory import RunHistory
from smac.scenario.scenario import Scenario
from cave.analyzer.base_analyzer import Ba... | timothyyu/ml_monorepo | CAVE/cave/analyzer/performance_table.py | performance_table.py | py | 13,673 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "cave.analyzer.base_analyzer.BaseAnalyzer",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "smac.runhistory.runhistory.RunHistory",
"line_number": 21,
"usage_type": "name"
},... |
12251368591 | # Blockchain algorithm
import json
from hashlib import sha256
from time import time
from uuid import uuid4
from PyPDF2 import PdfFileReader
from flask import Flask, jsonify, request
from urllib.parse import urlparse
import requests
FILE_PATH = "assets/Maupassant_Bel_Ami.pdf"
PAGE_ITERATION = 5
pages_list_selected = ... | MathisLeRoyNivot/blockchain-project | blockchain/blockchain.py | blockchain.py | py | 7,437 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "hashlib.sha256",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
10360844746 | import gurobipy as gp
from gurobipy import GRB
import numpy as np
import sys
import time
from xlrd import open_workbook
from xlutils.copy import copy
def read_input(file_a, file_b):
fp = open(file_a, 'r')
input_a = fp.read().split()
if file_b:
fp = open(file_b, 'r')
input_b = fp.read().spli... | JCP1014/Extensibility-of-TSN | solve.py | solve.py | py | 10,860 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "gurobipy.Model",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "gurobipy.GRB.BINARY",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "gurobipy.GRB",
... |
5717092453 | import pdb
def parse_bagtree_line(line):
line = line.strip()
target_color, remainder = line.split(" bags contain ")
# if target_color == 'faded blue':
# pdb.set_trace()
if remainder == "no other bags.":
children = []
else:
remainder = remainder[:len(remainder)-1] # trim period
if ',' not in remainder:
c... | jansenk/advent-of-code | advent/2020/solutions/day7.py | day7.py | py | 2,510 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 33,
"usage_type": "call"
}
] |
21661545594 | from flask import Flask, Response, request, make_response
import requests
import json
import datetime
from spark import main
import mysql.connector
db = mysql.connector.connect(
user='root',
passwd='xiaoyuqi123',
host='127.0.0.1',
database='project',
auth_plugin='mysql_native_password... | codetylor/dsci551project | app.py | app.py | py | 8,713 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 9,
"usage_type": "name"
},
{
"api... |
28640217795 | # -*- coding: utf-8 -*-
"""
Classes and functions for prefiltering (transforming) a line of user input.
This module is responsible, primarily, for breaking the line up into useful
pieces and triggering the appropriate handlers in iplib to do the actual
transforming work.
"""
__docformat__ = "restructuredtext en"
impor... | lumanjiao/XLS_BigData_Hue | build/env/lib/python2.7/site-packages/ipython-0.10-py2.7.egg/IPython/prefilter.py | prefilter.py | py | 11,615 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "re.match",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "IPython.ipapi.ipapi",
"line_numb... |
71090888693 | from flask import Flask, request, jsonify
from model import db, Person
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///mydatabase.db'
db.init_app(app)
# Create a new person
@app.route('/api', methods=['POST'])
def create_person():
data = request.json
new_person = Person(name=data['nam... | chisomd90/RESTFUL_API | app.py | app.py | py | 1,311 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "model.db.init_app",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "model.db",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "flask.request.json",
"line_nu... |
39989820150 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 13 11:19:42 2017
只显示选中的128块patches,其余添0
@author: cvpr
"""
import cv2
import numpy as np
patch_txt_path = '../patches_weight.txt'
img_path = '../data/Imageset/live2_renamed_images/000022.bmp'
img = cv2.imread(img_path)
f = open(patch_txt_path, 'rt')
line = f.readlines()... | JayMarx/VSBIQA | tools/show_patch.py | show_patch.py | py | 1,203 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 44,
"usage_type": "call"
}
] |
28501914141 | # 1698. Jump Game VI
# Medium
# You are given a 0-indexed integer array nums and an integer k.
# You are initially standing at index 0. In one move, you can jump at
# most k steps forward without going outside the boundaries of the
# array. That is, you can jump from index i to any index in the range [i
# + 1, min(n... | DmitryVlaznev/leetcode | 1696-jump-game-vi.py | 1696-jump-game-vi.py | py | 1,601 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 47,
"usage_type": "call"
}
] |
13197944709 | # -*- coding: utf-8 -*-
"""
Import from HE
==============
Aus einer Hystem-Extran-Datenbank im Firebird-Format werden Kanaldaten
in die QKan-Datenbank importiert. Dazu wird eine Projektdatei erstellt,
die verschiedene thematische Layer erzeugt, u.a. eine Klassifizierung
der Schachttypen.
"""
__author__ ... | hoettges/QKan | qkan/createunbeffl/k_unbef.py | k_unbef.py | py | 9,075 | python | de | code | 9 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "qgis.gui.QgisInterface",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "qkan.database.dbfunc.DBConnection",
"line_number": 34,
"usage_type": "name"
},
{
"api_na... |
72501002294 | import requests
from bs4 import BeautifulSoup
with open("sample.html", "r") as f:
html_doc = f.read() # html_doc will now contain the content of sample.html
soup = BeautifulSoup(html_doc, 'html.parser') # soup object
# print(soup.prettify()) # simply prints it
# print(soup.div.string, type(soup.div.string)) # ... | sufyan14/Web-Scrapping-Project | tags.py | tags.py | py | 1,684 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
}
] |
35751189759 | import sqlite3
import os
import clamd
import shutil
import progressbar
from subprocess import check_output
# Set the absolute path that should be scanned
PATH_TO_SCAN = os.environ['SCAN_DIR'] if 'SCAN_DIR' in os.environ else os.environ['HOME']
# Set the path of the quarantine dir
QUARANTINE_DIR = os.environ['QUARANTI... | DuckThom/simple-av-scanner | av-scanner.py | av-scanner.py | py | 3,667 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line... |
40970930403 | # 1. Count letters from both strings
# 2. Compare the occurances:
# a) If count(letter) is 1 in t and None on s. then return the letter
# b) elif count(letter) in greater in t than s. then return the letter
from collections import Counter
def findTheDifference(s, t): # O(N) complexity. But a bit faster as we'... | Mahmud-Buet15/Problem-Solving | Leetcode/389. Find the Difference.py | 389. Find the Difference.py | py | 1,002 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 22,
"usage_type": "call"
}
] |
4011914732 | import os
import requests
import json
import time
import xlsxwriter
import sys
from flask import Flask
my_app = Flask(__name__)
@my_app.route("/")
def hello():
return "Hello Flask, on Azure App Service for Linux"
def get_shortest_duration(origin, destination, avoid_tolls):
request_string = 'https://maps.google... | sagark9040/CommuteAnalyzer | application.py | application.py | py | 2,562 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 3... |
19710450761 | import pygame
import math
from pygame import mixer
# round_num keeps track of the current round number
global round_num
global plant_size
global shelf_rect_list
# Some Variables
InitialMoney = 50
plant_size = 64
# rectangle values: left, top, width, height
shelf_rect_list = [pygame.Rect(270, 178, 120, 100), pygame.Re... | rachel0427/Plant_Game | classes-parent.py | classes-parent.py | py | 10,397 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.Rect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.font.Font",
"line_numb... |
40756887022 | from sqlalchemy import create_engine
import re
from pandas import Series, DataFrame, concat
import pandas as pd
from pymongo import MongoClient
import subprocess as t
import logging
from logging.config import fileConfig
import configparser
fileConfig('logger_config.ini')
logger=logging.getLogger('infoLogger')
class L... | yyztc/itop | load_network.py | load_network.py | py | 4,412 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.config.fileConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": ... |
42487528283 | import networkx as nx
import matplotlib.pyplot as plt
def set_all_B(G):
for each in G.nodes():
G.node[each]['action']='B'
def set_A(G, list1):
for each in list1:
G.node[each]['action']= 'A'
def get_colors(G):
list1=[]
for each in G.nodes():
if G.node[each]['action']=='B':
... | rjsu26/SocialNetworksNPTEL | base_code.py | base_code.py | py | 2,207 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "networkx.erdos_renyi_graph",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "networkx.draw",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "matpl... |
1618578861 | import logging
import datetime
from time import sleep
logger = logging.getLogger(__name__)
def add(a, b):
logger.debug('START: {} + {} = {}'.format(a, b, a + b))
sleep(3)
filepath = 'task_created_file.txt'
with open(filepath, 'a') as f:
print(datetime.datetime.now(), file=f)
logger.d... | pentam19/python-task-queue-RQ-sample | tasks.py | tasks.py | py | 389 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
27071189306 | from fastapi import FastAPI, Response, status, HTTPException
from fastapi.params import Body
from pydantic import BaseModel
from typing import Optional
from random import randrange
import psycopg2
from psycopg2.extras import RealDictCursor
import time
app = FastAPI()
class Post(BaseModel):
title: str
content... | reekithak/FastAPI_DB | app/refer/main_sql.py | main_sql.py | py | 3,065 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "psycopg2.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "psycopg2.extras.R... |
17385814713 | from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from data.texts import texts
from math import ceil
import datetime
# LISTS WITH TEXT DATA
main_menu_button_callbacks = ["Book_", "KitchenAndBar_", "Reviews_", "ContactsAndAddresses_"]
list_with_addresses = ["Розыбакиева, 111", "Желтоксан, 118"]
CALLB... | Meorwik/LubiMoe_bot_2 | keyboards/simple_keyboards/simple_keyboards.py | simple_keyboards.py | py | 1,304 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "aiogram.types.InlineKeyboardMarkup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "aiogram.types.InlineKeyboardButton",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "aiogram.types.InlineKeyboardButton",
"line_number": 16,
"usage_type... |
74358358134 | from pyspark.sql import SparkSession
from pyspark.sql.functions import col, count, countDistinct
from pyspark.sql.functions import desc, year, sum, lit, when, min, avg, max, col, split, explode, count, lower
from pyspark.sql.types import StructType, StructField, StringType, IntegerType, DoubleType
spark = SparkSession.... | Malware87/bigdatalearning | C5.py | C5.py | py | 955 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 5,
"usage_type": "... |
1324168949 | import os
import sys
import cv2
import json
import torch
import shutil
import requests
import subprocess
from tqdm import tqdm
from time import strftime
from argparse import Namespace
root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
diffusers_root_path = os.path.join(root_path, "diffusers")
sys.... | wladradchenko/wunjo.wladradchenko.ru | portable/src/diffusers/inference.py | inference.py | py | 36,465 | python | en | code | 404 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
37870385293 | import json
class WikiCountry:
def __init__(self,input_file,output_file):
self.num = -1
self.input_file = input_file
self.output_file = output_file
with open(self.input_file) as f:
self.countries = json.load(f)
self.end = len(self.countries)
def __iter__(self):
return self
def __next__(self):
... | yadolph/hw_iterators_generators_yield | main.py | main.py | py | 776 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
}
] |
26856473502 | import pytest
from common import CommonTests
from utils import imc_classfication
imc_classfication_test_data = [
(50, 1.75, 'Abaixo do peso'),
(70, 1.75, 'Peso normal'),
(90, 1.75, 'Sobrepeso'),
(104, 1.84, 'Obesidade grau I'),
(120, 1.75, 'Obesidade grau II'),
(130, 1.75, 'Obesidade grau III')... | Pubnic/test-parametrized-pytest | tests/test_utils.py | test_utils.py | py | 797 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "common.CommonTests",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "utils.imc_classfication",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "py... |
21829202362 | # Определить, какое число в массиве встречается чаще всего.
# Определим функцию которая считает полный размер элемента
import sys
def get_size(x, size = 0):
size += sys.getsizeof(x)
if hasattr(x, '__iter__'):
if hasattr(x, 'items'):
for key, value in x.items():
... | Romigor/geek_algoritm_py | les6_task_1.py | les6_task_1.py | py | 2,944 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "sys.getsizeof",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
28599843766 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('library', '0006_auto_20160204_1254'),
]
operations = [
migrations.AddField(
model_name='student',
na... | abhisheksoam/Library | gbpeclibrary/library/migrations/0007_auto_20160204_1334.py | 0007_auto_20160204_1334.py | py | 555 | python | en | code | 0 | github-code | 21 | [
{
"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.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
43384113180 | import logging
from threading import Thread
import math
import json
import traceback
import time
import os
import socket
from .config import Config
from .actions import ACTIONS
# JSON, int, float, decode and more_to_recv are generated and dont need to be specified
FLAGS = ["", "bool", "float", "int", "json", "decode... | maxschwe/PiCar | pi/tcp/tcp_handler.py | tcp_handler.py | py | 8,928 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "actions.ACTIONS.LIVESTREAM",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "actions.ACTIONS",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "acti... |
24019416672 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('api', '0029_auto_20150614_1644'),
]
operations = [
migrations.AlterField(
model_name='tellzone'... | mahendrakalkura/tellecast | api/migrations/0030_auto_20150614_1744.py | 0030_auto_20150614_1744.py | py | 433 | python | en | code | 0 | github-code | 21 | [
{
"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"
},
{... |
26884788442 | import re
from PIL import Image
from datetime import date
import time
import hashlib
from random import random
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.contrib.gis.db import models as gis_models
fr... | RumorIO/healersource | apps/clients/models.py | models.py | py | 24,136 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.Model",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "django.db.models.OneToOneField",
"line_number": 83,
"usage_type": "call"
},
{
"api_n... |
71231079414 | from __future__ import absolute_import, unicode_literals
from celery import shared_task
from .models import Period, Register, Value2
from django.utils import timezone
import time
from random import randint
@shared_task
def add(x, y):
return x + y
@shared_task
def mul(x, y):
return x * y
@shared_task
def x... | AleksZ13ru/ModbusDJ | mb_server/tasks.py | tasks.py | py | 2,072 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "celery.shared_task",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "celery.shared_task",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "celery.shared_task",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "random.randin... |
37006238938 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Convert Context-Free Grammar (CFG) to Chomsky Normal Form (CFG)
Notes
-----
This file can be used as a script or as a package. The script section
also serves as the class usage example.
Important:
S -> ε (empty string) is assumed to be valid by default.
If ther... | mrfirdauss-20/Tubes-TBFO | cfg2cnf.py | cfg2cnf.py | py | 16,147 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 260,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
... |
4370201211 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 21 12:45:28 2020
@author: Shahla
"""
import matplotlib.pyplot as plt
import numpy as np
data = {'a': np.arange(50),
'c': np.random.randint(0, 50, 50),
'd': np.random.randn(50)}
data['b'] = data['a'] + 10 * np.random.randn(50)
data['d'] = np.abs(data['d'... | ShahlaYadollahi/MachineLearningBootcamp | matplotlib_exercise.py | matplotlib_exercise.py | py | 1,231 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.arange",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand... |
8648753807 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from argparse import ArgumentParser
import tensorflow as tf
import tensorflow.contrib.slim as slim
import tensorflow.examples.tutorials.mnist as mnist
batch_size = 1000
IMAGE_SIZE = mnis... | tue-robotics-graveyard/tensorflow_playground | mnist_slim.py | mnist_slim.py | py | 1,780 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.examples.tutorials.mnist.mnist",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.examples.tutorials.mnist",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tensorflow.contrib.slim.layers.fully_connected",
"line_num... |
10725692223 | import numpy as np
import pandas as pd
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdMolTransforms
import os
import sys
def check_aromatic(atom):
"""
aromatic systems assumed to: be in a ring, be carbon (3 neighbors) or nitrogen (2 or 3 neighbors)
RDKit is unreliable for t... | ndricke/ngcc_ml | group_aromatics.py | group_aromatics.py | py | 7,646 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rdkit.Chem.rdMolTransforms.GetDihedralDeg",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem.rdMolTransforms",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "numpy.abs",
"line_number": 41,
"usage_type": "call"
},
{
"ap... |
73898614134 | import torch
import torch.nn as nn
from Model.AttentionBlock import AttentionBlock
class TransductiveGNN(nn.Module):
"""GNN for transductive learning"""
def __init__(self, in_feature, out_feature, n_heads=(8, 1), dropout=0.5):
super().__init__()
self.n_heads = n_heads
for i in range(n_heads[0]):
setattr(sel... | Tianananana/GAT-implementation | Model/TransductiveGNN.py | TransductiveGNN.py | py | 1,641 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "Model.AttentionBlock.AttentionBlock",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Model... |
9870180677 | #!/usr/bin/env python3
from datetime import datetime, time, timedelta
from logging import Logger, getLogger
from pytz import timezone
from requests import Session
from parsers.lib.config import refetch_frequency
from parsers.lib.exceptions import ParserException
TIMEZONE = "America/Costa_Rica"
EXCHANGE_URL = (
... | electricitymaps/electricitymaps-contrib | parsers/CR.py | CR.py | py | 6,236 | python | en | code | 3,126 | github-code | 21 | [
{
"api_name": "datetime.datetime",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "pytz.timezone",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "requests.Session",
... |
74121407091 | import torch
import numpy as np
from GROVER_finetune.utils import global_initiate, build_finetune_model
from GROVER_finetune.train_and_test import train
from GROVER_finetune.arguments import DataArgs, FinetuneArgs, TrainingArgs
torch.manual_seed(0)
np.random.seed(0)
data_args = DataArgs(
data_path='exampledata/fi... | XuanVuNguyen/fine_tune_grover | train_script.py | train_script.py | py | 1,559 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "torch.manual_seed",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "GROVER_finetune.ar... |
9521481353 | import pygame
import os
pygame.init()
pygame.font.init()
fontSize = 60
myfont = pygame.font.SysFont('Calibri', fontSize, True)
# Window size
WIDTH = 1366
HEIGHT = 768
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))
# Window title
pygame.display.set_caption("Strange")
BORDERONE = pygame.Rect(0, 0... | papajake217/Strange | main.py | main.py | py | 7,931 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.font.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.SysFont",
... |
35711248728 | from copy import deepcopy
from typing import List
Grid = List[List[str]]
def get_adjacent(grid: Grid, x: int, y: int) -> List[str]:
width, height = len(grid[0]), len(grid)
points = (
(x + 1, y),
(x - 1, y),
(x, y + 1),
(x, y - 1),
(x + 1, y + 1),
(x + 1, y - 1... | Celeo/adventofcode | 2020/day11/part1.py | part1.py | py | 1,354 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number"... |
11872102889 | import os
import math
import argparse
import numpy as np
import multiprocessing as mp
from PIL import Image
import gym
import gym_avd
def str2bool(v):
return True if v.lower() in ["t", "true", "y", "yes"] else False
parser = argparse.ArgumentParser()
parser.add_argument("--save_directory", type=str, default="... | facebookresearch/exploring_exploration | reconstruction_data_generation/avd/gather_uniform_points.py | gather_uniform_points.py | py | 2,890 | python | en | code | 60 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "os.mkdir",
... |
33254993584 | import sys
from os.path import join, dirname
from world.world import World
from utils.utils import clear, getch
class GameCmd(object):
def __init__(self, metamodel_file, model_file) -> None:
super().__init__()
self._world = World(metamodel_file, model_file)
def _print_place_description(s... | rodusek-v/gui-tad | game/game.py | game.py | py | 3,077 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "world.world.World",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.utils.clear",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "utils.utils.getch",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path.dirname... |
69890785652 |
from django.urls import path
from order.views import add_to_cart, remove_to_cart, OrderSummaryView, CheckoutView, PaymentView
urlpatterns = [
path('add_to_cart/<slug>/', add_to_cart, name="add_to_cart"),
path('remove_to_cart/<slug>/', remove_to_cart, name="remove_to_cart"),
path('summary', OrderSummaryVi... | BerkAcikel45/iakademi-2022 | django/order/urls.py | urls.py | py | 495 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "order.views.add_to_cart",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "order.view... |
73037115573 | from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultArticle(InlineQueryResult):
"""This object represents a Telegram InlineQueryResultArticle.
Attributes:
id (str):
title (str):
input_message_content (:class:`telegram.InputMessageCo... | LiuFang816/SALSTM_py_data | python/python-telegram-bot_python-telegram-bot/python-telegram-bot-master/telegram/inlinequeryresultarticle.py | inlinequeryresultarticle.py | py | 2,618 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "telegram.InlineQueryResult",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "telegram.InlineKeyboardMarkup.de_json",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "telegram.InlineKeyboardMarkup",
"line_number": 78,
"usage_type": "name"
... |
35591538346 | import boto3
session = boto3.Session()
db_r = session.resource('dynamodb')
db_c = session.client('dynamodb')
table_name = 'pkg_radar_packages_prod'
rcu = 100
wcu = 20
respsonse = db_c.update_table(
TableName=table_name,
ProvisionedThroughput={
'ReadCapacityUnits': rcu,
'WriteCapacityUnits': w... | dkh215/pkg-radar-api | scripts/update_table_capacity.py | update_table_capacity.py | py | 349 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "boto3.Session",
"line_number": 3,
"usage_type": "call"
}
] |
1661524710 | # import i as i
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import os
import time
from scipy import stats
file = 'D:\TD\help_others\qianqinhao\二步处理\\YearMean3.xlsx'
df = pd.read_excel(file)
name = ['年平均气温', '四到九月平均气温', '七八月平均气温', '四到九月大于十三度的积温', '四到九月降水量', '六月降水量',
'持续天数','五到八月日照... | DRAGONINWAVE/for_little_sun | help_others/qianqinhao/二步处理/qianqinghao_picture.py | qianqinghao_picture.py | py | 2,285 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pandas.read_excel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "seaborn.set_theme",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotl... |
31122339977 | #!/usr/bin/env python3
from setuptools import setup, Extension, Command
import os.path
import os
import platform
import setuptools
import sys
import glob
print("Building on:", sys.version)
with open("requirements.txt", "r", encoding="utf8") as fh:
requirements = fh.readlines()
enableParallelism = True
extraOptio... | ABenatti/network_symmetry | setup.py | setup.py | py | 5,535 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.version",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "platform.system",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.environ",
"lin... |
2920829210 | import json
import os
from pathlib import Path
from selenium import webdriver
class CookieManager:
"""Cookie managing. Store and load saved cookies to the driver"""
def __init__(self, cookie_file_path: Path):
self.cookie_file = cookie_file_path
self.initialize_cookie_storage()
def initi... | chemradio/cta-gfx-helper | utils/cookie_file_generator/logic/cookie_manager.py | cookie_manager.py | py | 1,987 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number... |
73028073333 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | LiuFang816/SALSTM_py_data | python/apache_incubator-airflow/incubator-airflow-master/tests/www/api/experimental/test_endpoints.py | test_endpoints.py | py | 3,938 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "airflow.configuration.load_test_config",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "airflow.configuration",
"line_number": 25,
"usage_type": "name"
},
{
... |
2702315307 | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
import numpy
from pyscf.lib import logger
from pyscf import scf
from pyscf import symm
from pyscf import fci
from pyscf.mcscf import casci
from pyscf.mcscf import addons
class CASCI(casci.CASCI):
def __init__(self, mf, ncas, nelecas, ncore=Non... | sunchong137/pyscf_2017 | mcscf/casci_symm.py | casci_symm.py | py | 4,558 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pyscf.mcscf.casci.CASCI",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pyscf.mcscf.casci",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pyscf.mcscf.casci.CASCI.__init__",
"line_number": 21,
"usage_type": "call"
},
{
"a... |
31196417376 | import glob
import sys
# Note: This script depends on Pillow
from PIL import Image
if __name__ == "__main__":
if sys.version_info < (3, 4):
print('Python 3.4 or higher needed to run this script')
sys.exit(1)
if len(sys.argv) != 2:
print('Usage: python pack_png.py <path to png image>')
sys.exit(1)
img_pat... | nfrechette/acl | tools/graph_generation/pack_png.py | pack_png.py | py | 625 | python | en | code | 1,183 | github-code | 21 | [
{
"api_name": "sys.version_info",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_numb... |
26707592766 | import boto3
import os
import time
import os.path
import shutil
from datetime import date
import datetime
from archiving import archive_files
from send_email import send_email_notification
s3 = boto3.resource('s3')
dt = datetime.datetime.today()
# Buckets that files will be uploaded to
beft_afternoon_int = 'beft-afte... | don9000/beft_automation_win | upload_alert_archive.py | upload_alert_archive.py | py | 1,619 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "boto3.resource",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.list... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.