id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
1740396 | <filename>cogs/premium.py
import discord
from discord.ext import commands
#definir classe
class premium(commands.Cog):
def __init__(self, client):
self.client = client
#evento webhook
@commands.cooldown(1,5, commands.BucketType.user)
@commands.guild_only()
@commands.command()
a... | StarcoderdataPython |
1739890 | from tkinter import messagebox
import tradlib
import shutil
import sys
import os
active_language = "english" # default on start
def get_resources_path(relative_path):
try:
file_name = relative_path.split("\\")[-1]
base_path = sys._MEIPASS
return os.path.join(base_path + "\\" + file_name)... | StarcoderdataPython |
1642564 | <reponame>nuaa-QK/1_NAS
import os, sys, queue, time, random, re, json
import datetime, traceback, pickle
import multiprocessing, copy
from base import Network, NetworkItem, Cell
from info_str import NAS_CONFIG, MF_TEMP
def _dump_stage(stage_info):
_cur_dir = os.getcwd()
stage_path = os.path.join(_cur... | StarcoderdataPython |
3295290 | import time
from .settings import *
# Selecionando o algoritmo para exibir na tela
def draw_lines(grid, algorithm, posX1, posY1, posX2, posY2, color, rows, pixel_size, line):
# Como posições são sempre floats, arredondarei para int
posX1, posX2, posY1, posY2 = int(posX1), int(posX2), int(posY1), int(posY2)
# Não... | StarcoderdataPython |
80882 | import usb.core
devices = usb.core.find(find_all=True)
if devices is None:
raise ValueError('Danger zone?')
for device in devices:
print('============')
config = device.get_active_configuration()
deviceIndex = config.index
product = device.product
portNum = device.port_number
print('i... | StarcoderdataPython |
136769 | #!/usr/bin/env python
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import os
import re
import subprocess
import sys
import click
from babel.dates impo... | StarcoderdataPython |
1782311 | <reponame>ospiper/Sandbox-Runner
class JudgerException(Exception):
def __init__(self, message):
super().__init__()
self.message = message
class JudgerError(JudgerException):
pass
| StarcoderdataPython |
3917 | <gh_stars>1-10
# GridGain Community Edition Licensing
# Copyright 2019 GridGain Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause
# Restriction; you may not use this file except in compliance with the License. You may obtain... | StarcoderdataPython |
3333582 | <gh_stars>0
#extract to .py file later
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import itertools
import scipy.special
from decimal import *
import unittest as ut
from sympy.solvers import solve
from sympy import Symbol
from scipy.constants import golden as phi
from matplotlib.c... | StarcoderdataPython |
153404 | <filename>project/database_controller/user_projects.py
import json
from project.database_controller.app import db
from project.models import Project
def get_project(project_id: int) -> json:
"""
:param project_id:
:return:
"""
query_result = db.session.query(Project).filter(Project.id == project_... | StarcoderdataPython |
4802216 | <filename>polarion/email_report.py
#!/usr/bin/env python
"""
Module to generate email report post extracting automation status from polarion.
"""
import os
import smtplib
import sys
import time
from datetime import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import pyt... | StarcoderdataPython |
3308110 | # Author: <NAME> <<EMAIL>>
from pycocotools.coco import COCO
from pycocotools import mask
from tensorpack.utils.segmentation.segmentation import visualize_label
import numpy as np
coco_dataset = "/data2/dataset/coco"
detection_json_train = "/data2/dataset/annotations/instances_train2014.json"
detection_json_val = ... | StarcoderdataPython |
60730 | <filename>loopy/schedule/tools.py
__copyright__ = "Copyright (C) 2016 <NAME>"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation th... | StarcoderdataPython |
1656071 | <reponame>Dan-Freda/python-challenge<filename>PyBank/main.py
# Py Me Up, Charlie (PyBank)
# Import Modules/Dependencies
import os
import csv
# Initialize the variables
total_months = 0
net_total_amount = 0
monthy_change = []
month_count = []
greatest_increase = 0
greatest_increase_month = 0
greatest_decrease = 0
grea... | StarcoderdataPython |
1777521 | class QueryResult:
def __init__(self, icon='', name='', description='', clipboard=None, value=None, error=None, order=0):
self.icon = icon
self.name = name
self.description = description
self.clipboard = clipboard
self.value = value
self.error = error
self.ord... | StarcoderdataPython |
1763383 | <gh_stars>0
#entrada
Edays = int(input())
#variavel
days = 0
month = 0
year = 0
#definido quantidade de meses
month = Edays // 30
#condição se meses maior ou igual a 12
if month >= 12:
#calculo de anos
year = Edays // 365
#dias restantes
Edays = Edays - (year * 365)
#calcul... | StarcoderdataPython |
100764 | <filename>scripts/clues_plot_trajectory.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Customised version of https://github.com/35ajstern/clues/blob/master/plot_traj.py
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import argparse
import json
from math import ceil
import numpy as np
from matplotlib import py... | StarcoderdataPython |
13035 | import pandas as pd
# Global variable to set the base path to our dataset folder
base_url = '../dataset/'
def update_mailing_list_pandas(filename):
"""
Your docstring documentation starts here.
For more information on how to proper document your function, please refer to the official PEP... | StarcoderdataPython |
119871 | '''
Author : <NAME>
API Project for Olympics Database
Takes requests using the flask app route in browser and returns list of dictionaries containing results.
'''
import sys
import argparse
import flask
import json
import psycopg2
from config import user
from config import password
from config import datab... | StarcoderdataPython |
3300126 | <reponame>LaudateCorpus1/oci-python-sdk<filename>src/oci/object_storage/models/object_lifecycle_rule.py<gh_stars>0
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://... | StarcoderdataPython |
155201 | <reponame>nabetama-training/CompetitionProgrammingPractice
def resolve():
n, m, l = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(m)]
c = []
for i in range(n):
tmp = []
for j in range(l):
... | StarcoderdataPython |
1612791 | <gh_stars>1-10
"""
Helper functions for the commands.
"""
import os
import logging
from typing import Tuple
from django.conf import settings as sett
logger = logging.getLogger(__name__)
def get_p_run_name(name: str, return_folder: bool=False) -> Tuple[str, str]:
"""
Determines the name of the pipeline run... | StarcoderdataPython |
3386563 | <gh_stars>1-10
import unittest
from stareg.penalty_matrix import PenaltyMatrix
from stareg.bspline import Bspline
import numpy as np
from scipy.signal import find_peaks
class TestPenaltyMatrix(unittest.TestCase):
def setUp(self):
self.n_param = 25
self.PM = PenaltyMatrix()
def tearDown(self)... | StarcoderdataPython |
1654636 | from pathlib import Path
import pytest
from configuror.exceptions import DecodeError
def test_method_returns_false_when_file_is_unknown_and_ignore_flag_is_true(config):
assert not config.load_from_python_file('foo.txt', ignore_file_absence=True)
def test_method_raises_error_when_file_is_unknown_and_ignore_fla... | StarcoderdataPython |
4811466 | <gh_stars>1-10
from typing import Any
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.utils.translation import gettext_lazy as _
class TimestampedModel(models.Model):
"""
An abstract class to be extended to add timestamp to models
"""
# auto_now_add will... | StarcoderdataPython |
181954 | import unittest
from attacking_queens.board import ChessBoard, WhiteQueen
from attacking_queens.board import BlackQueen
from attacking_queens.exceptions import BadQueenPlacementException
class PlacingQueensTests(unittest.TestCase):
def setUp(self):
self.board = ChessBoard(size=5)
def test_place_bla... | StarcoderdataPython |
185539 | from xgboost_ray.tests.utils import create_parquet
def main():
create_parquet(
"example.parquet",
num_rows=1_000_000,
num_partitions=100,
num_features=8,
num_classes=2)
if __name__ == "__main__":
main()
| StarcoderdataPython |
1725684 | temp = float(input('Digite a temperatura '))
k = 273.15 + temp
f = (temp * 9/5) + 32
print('A temperatura digitada é de {}ºC \n Fahrenheit {}ºF \n Kelvin {}K'.format(temp, k ,f)) | StarcoderdataPython |
29823 | <reponame>dwpaley/cctbx_project
from __future__ import absolute_import, division, print_function
from libtbx import test_utils
import libtbx.load_env
#tst_list = [
# "$D/regression/tst_py_from_html.py"
# ]
tst_list = [
"$D/regression/tst_1_template.py",
"$D/regression/tst_2_doc_high_level_objects.py",
"$D/reg... | StarcoderdataPython |
3371505 | import os
import pickle
import numpy as np
from matplotlib import pyplot as plt
from sklearn.ensemble import ExtraTreesClassifier
def dim_reduc_protocol(pickle_filepath, plot_file_name):
"""
Execute the dimensionality reduction protocol to the given pickle file
:param str pickle_filepath: The pickle file
:param ... | StarcoderdataPython |
195890 | <reponame>fding/pyedifice
import logging
# Support for colored logging: https://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
#The background is set with 40 plus the number of the color, and the foreground with 30
#These are ... | StarcoderdataPython |
94878 | import config
import random
import datetime, time
import math
def execute(parser, bot, user, args):
slotsPool = bot.execQuerySelectOne("SELECT * FROM slotspool")
bot.addressUser(user, "The current slots jackpot is %d %s." % (slotsPool["slotspool"], config.currencyPlural))
def requiredPerm():
... | StarcoderdataPython |
3317115 | from .nhl_api import nhl
| StarcoderdataPython |
135577 | <reponame>estradjm/Class_Work
#!/bin/python
''
treeds.py for tree data structure, taken from StackOverflow at https://stackoverflow.com/questions/2358045/how-can-i-implement-a-tree-in-python-are-there-any-built-in-data-structures-in
''
class Node:
"""
Class Node
"""
def __init__(self, value):
... | StarcoderdataPython |
65502 | <reponame>DevikalyanDas/Multiclass-Segmentation
import torch
def _threshold(x, threshold=None):
if threshold is not None:
return (x > threshold).type(x.dtype)
else:
return x
def make_one_hot(labels, classes):
one_hot = torch.FloatTensor(labels.size()[0], classes, labels.size()[2],... | StarcoderdataPython |
3273120 | <reponame>barnjamin/py-algorand-sdk
from algosdk.abi.uint_type import UintType
from algosdk.abi.ufixed_type import UfixedType
from algosdk.abi.base_type import ABIType
from algosdk.abi.bool_type import BoolType
from algosdk.abi.byte_type import ByteType
from algosdk.abi.address_type import AddressType
from algosdk.abi.... | StarcoderdataPython |
55970 | <filename>fcn.py
import numpy as np
import random
import pandas as pd
def remove_outlier(feature, name, data):
q1 = np.percentile(feature, 25)
q3 = np.percentile(feature, 75)
iqr = q3-q1
cut_off = iqr*1.5
lower_limit = q1-cut_off
upper_limit = q3+cut_off
data = data.drop(data[(data[name] > ... | StarcoderdataPython |
1702135 | <filename>Chapter 02/Chap02_Example2.59.py<gh_stars>0
s1 = "welcome <NAME>"
print(s1.upper()) # -- UO1
s2 = "PYTHON"
print(s2.upper()) # -- UO2
s3 = "be@UTIfull"
print(s3.upper()) # -- UO3
s4 = "I love python language!:)"
print(s4.upper()) # -- UO4
s5 = 'th3ree'
print(s5.upper()) # -- UO5
| StarcoderdataPython |
101686 | <filename>examples/hello.py
import ppytty
ppytty_task = ppytty.Label('Hello world!')
| StarcoderdataPython |
1600442 | <gh_stars>0
valores = []
while True:
v = int(input('digite os valores: '))
c = input('quer continuar? [s/n]: ')
if c == 'n':
break
if v not in valores:
valores.append(v)
print('numero adicionado com sucesso...')
else:
print('numero duplicado, não irei adicionar...')
v... | StarcoderdataPython |
161880 | from django.urls import path
from . import views
from qa.views import UserAnswerList, UserQuestionList
app_name = "user_profile"
urlpatterns = [
path("activate/<uidb64>/<token>/", views.EmailVerify.as_view(), name="activate"),
path("<int:id>/<str:username>/", views.profile, name="profile"),
path(
... | StarcoderdataPython |
3292224 | <gh_stars>0
__title__ = 'DPT detail extractor'
__author__ = '<NAME>'
__contact__ = '<EMAIL>'
__date__ = '2018-07-30'
__version__ = 1.0
#%% Load Packages
import numpy as np
from SignificantFeatures import SignificantFeatures
from TextureExtraction import Textures
from RoadmakersPavage import RP_DPT
def Extr... | StarcoderdataPython |
463 | <gh_stars>0
#encoding=utf-8
import qlib
import pandas as pd
import pickle
import xgboost as xgb
import numpy as np
import re
from qlib.constant import REG_US
from qlib.utils import exists_qlib_data, init_instance_by_config
from qlib.workflow import R
from qlib.workflow.record_temp import SignalRecord, PortAnaRecord
fro... | StarcoderdataPython |
191754 | #!/usr/bin/env python
# coding: utf-8
from baseframe import Plugin
class MyPlugin(Plugin):
info = {
'name': '<NAME>',
'tag': 'sqli'
}
rules = [
{
'desc': 'PHP常见SQLi过滤函数',
'rule': (
r'(?i)get_magic_quotes_gpc\(|intval\(|addslashes\(|strip_ta... | StarcoderdataPython |
118703 | import logging
from rest_framework import serializers, exceptions
logger = logging.getLogger(__name__)
class ResourceTypeSerializer(serializers.Serializer):
'''
Serializer for describing the types of available Resources
that users may choose.
'''
resource_type_key = serializers.CharField(max_leng... | StarcoderdataPython |
1791719 | <filename>server/commandcentre.py
class CommandCentre:
def __init__(self):
self.order_status = {}
self.drone_status = {1: "Idle"}
def add_order(self, order_id):
self.order_status[order_id] = "Order is placed and we are working on it."
def completed_order(self, order_id):
self.order_status[order... | StarcoderdataPython |
1786537 | <reponame>yugangw-msft/AutoRest<filename>src/generator/AutoRest.Python.Tests/AcceptanceTests/dictionary_tests.py
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of... | StarcoderdataPython |
72111 | <gh_stars>1-10
"""
Created by auto_sdk on 2019.05.06
"""
from aliexpress.api.base import RestApi
class AliexpressSolutionProductSchemaGetRequest(RestApi):
def __init__(self, domain="gw.api.taobao.com", port=80):
RestApi.__init__(self, domain, port)
self.aliexpress_category_id = None
def getap... | StarcoderdataPython |
1709398 | <filename>src/mastermind/game/board.py<gh_stars>0
import random
class Board:
""" (AH). The Prepare Method and _Create_Hint Method were given.
A code template to track the gameboard for a Mastermind game.
The responsibility of this class of objects is to prepare the gameboard
with a random four digit ... | StarcoderdataPython |
3384749 | <reponame>monasca/dbuild
# (C) Copyright 2017 Hewlett Packard Enterprise Development LP
#
# 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
#
# Unle... | StarcoderdataPython |
52744 | <filename>0306_more_guest.py<gh_stars>0
#!/usr/bin/python
import sys
def main():
guest_lists = ['senthil', 'raj', 'ameen']
print("Hi Everyone! I found a bigger dinner table. I would like to invite more people for Dinner.")
guest_lists.insert(0, 'naveen')
guest_lists.insert(2, 'prabhu')... | StarcoderdataPython |
4840218 | # Copyright (c) OpenMMLab. All rights reserved.
from mmocr.models.builder import RECOGNIZERS
from .encode_decode_recognizer import EncodeDecodeRecognizer
@RECOGNIZERS.register_module()
class SARNet(EncodeDecodeRecognizer):
"""Implementation of `SAR <https://arxiv.org/abs/1811.00751>`_"""
| StarcoderdataPython |
1745558 | <filename>src/third_party/wiredtiger/dist/style.py
#!/usr/bin/env python
# Check the style of WiredTiger C code.
from dist import source_files
import re, sys
# Complain if a function comment is missing.
def missing_comment():
for f in source_files():
skip_re = re.compile(r'DO NOT EDIT: automatica... | StarcoderdataPython |
3271733 | <filename>Sorting/inversions.py
def Count(array, n):
if(n == 1):
return 0
else:
a = array[0:(n/2)]
b = array[(n/2):n]
# print(array)
# print(a)
# print(b)
x = Count(a, len(a))
y = Count(b, len(b))
z = CountSplitInversions(array, n)
... | StarcoderdataPython |
162999 | <reponame>LinusU/t1-runtime<gh_stars>0
{
"includes": [
"common.gypi",
],
"targets": [
{
"target_name": "colony-lua",
"product_name": "colony-lua",
"type": "static_library",
"defines": [
'LUA_USELONGLONG',
],
"sources": [
'<(colony_lua_path)/src/lapi.c'... | StarcoderdataPython |
6078 | import numpy as np
import scipy as sp
import scipy.sparse.linalg as splinalg
def eig2_nL(g, tol_eigs = 1.0e-6, normalize:bool = True, dim:int=1):
"""
DESCRIPTION
-----------
Computes the eigenvector that corresponds to the second smallest eigenvalue
of the normalized Laplacian matrix ... | StarcoderdataPython |
1761093 | import logging
import requests
import numpy as np
FIND_PLACE = "https://maps.googleapis.com/maps/api/place/findplacefromtext/json?"
PLACE_DETAILS = "https://maps.googleapis.com/maps/api/place/details/json?"
def place_by_name(place, key, FIND_PLACE=FIND_PLACE):
"""Finds a Google Place ID by searching with its nam... | StarcoderdataPython |
92442 | <reponame>chenke91/ihaveablog
from random import randint
from flask import render_template, request, current_app, jsonify
from app.models import Blog, User, Reply
from .forms import ReplyForm
from . import main
@main.route('/')
def index():
args = request.args
page = args.get('page', 1, type=int)
blogs = B... | StarcoderdataPython |
3324284 | from concurrent.futures import ThreadPoolExecutor
def exam(s, show_all, is_exam: bool = 1):
with ThreadPoolExecutor() as e:
return [
future.result() for future in [
e.submit(s.data.exam_GetExamContent, iExamId=exam['sQuestionIds'])
for exam in s.data.homework_Ge... | StarcoderdataPython |
21098 | <gh_stars>0
# Generated by Django 3.2 on 2021-05-05 12:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('image_repo', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='image',
name='colors',
... | StarcoderdataPython |
3269532 | from gtfparse import read_gtf
from .constants import FEATURES, NON_CODING_BIOTYPES
import logging
import click
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
level=logging.INFO,
)
def write_bed(bed_df, output_file_name, uncompressed):
if uncompressed:
bed_df.t... | StarcoderdataPython |
1696421 | <gh_stars>0
# -*- coding: utf-8 -*-
from .action import *
from .jwt import * | StarcoderdataPython |
42609 | <reponame>NNemec/meson<filename>test cases/common/95 dep fallback/gensrc.py
#!/usr/bin/env python
import sys
import shutil
shutil.copyfile(sys.argv[1], sys.argv[2])
| StarcoderdataPython |
3386849 | from rest_framework import serializers
from main.models import Curriculum, TreatmentPlan, PatientProfile, AssistantProfile
class CurriculumSerializer(serializers.ModelSerializer):
class Meta:
model = Curriculum
exclude = ['uploaded_at', 'patient']
class TreatmentPlanSerializer(serializers.ModelS... | StarcoderdataPython |
166476 | from openvino.inference_engine import IECore, IENetwork
class Network:
#Constructor class to declare variables, any of these still as 'None' in console, an error occured when initializing it
def __init__(self):
#NEED TO: put ntoes done indicating what each does
self.plugin = None
... | StarcoderdataPython |
76870 | <reponame>temelkirci/Motion_Editor
#!C:\Users\DOF\Desktop\DOF_Motion_Editor\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'astropy==3.0.5','console_scripts','wcslint'
__requires__ = 'astropy==3.0.5'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.s... | StarcoderdataPython |
3295831 | <reponame>winclap/aldjemy<gh_stars>0
import django
class LogsRouter(object):
ALIAS = 'logs'
def use_logs(self, model):
return hasattr(model, '_DATABASE') and model._DATABASE == self.ALIAS
def db_for_read(self, model, **hints):
if self.use_logs(model):
return self.ALIAS
d... | StarcoderdataPython |
3327721 | <gh_stars>10-100
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class ISCSIDataIn(Base):
__slots__ = ()
_SDM_NAME = 'iSCSI_Data_In'
_SDM_ATT_MAP = {
'HeaderOpcode': 'iSCSI_Data_In.header.Opcode-1',
'HeaderFlags': 'iSCSI_Data_In.header.Flags-2',
'Hea... | StarcoderdataPython |
125017 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SPAM Rados Module
"""
import spam.ansirunner
import re
class Rados(object):
"""
SPAM Rados class
"""
def __init__(self):
"""
Initialize Rados class.
"""
self.runner = spam.ansirunner.AnsibleRunner()
... | StarcoderdataPython |
3345859 | <gh_stars>0
import os
import json
# =========== DO NOT USE ANYMORE ===================
# This File was only used, to assign the retrieved values
# to it's respective video. The result can be found in
# metadata_ai.json
# ==================================================
#List chosen videos
videos = os.listdir(
'... | StarcoderdataPython |
1638404 | <filename>Calc_dobro_triplo_raiz.py
n = int(input('digite um número'))
d = n * 2
t = n * 3
r = n ** (1/2)
print(" analisando o valor {}, o dobro vale {}, o triplo vale {} , a raiz quadrada desse número é {:.3f}".format(n, d, t, r))
| StarcoderdataPython |
3232508 | <filename>clees_misc.py
# ----------------------------------
# CLEES Misc
# Author : Tompa
# ----------------------------------
# ------------------ General libs --------------
import time
# ------------------ Private Libs --------------
import clees_settings
import clees_io
import clees_object... | StarcoderdataPython |
16954 | # Copyright 2018 ZTE Corporation.
#
# 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 ... | StarcoderdataPython |
4819595 | # -*- coding: utf-8; -*-
#
# @file template_parser.py
# @brief Base class for packager templage node.
# @author <NAME> (INRA UMR1095)
# @date 2014-06-03
# @copyright Copyright (c) 2014 INRA
# @license MIT (see LICENSE file)
# @details Allow to parse Django templates and to find what are the used custom tag and theirs v... | StarcoderdataPython |
154906 | # Generated by Django 3.2.8 on 2021-11-17 13:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Ruby', '0003_auto_20211117_1334'),
]
operations = [
migrations.AlterField(
model_name='user',
... | StarcoderdataPython |
1602776 | <reponame>simoore/cantilever-designer
import numpy as np
import microfem
class FrequencyProblem(object):
def __init__(self, params, topology_factory):
self.f0 = params['f0']
self.topology_factory = topology_factory
self.material = microfem.SoiMumpsMaterial()
@pr... | StarcoderdataPython |
1759265 | def minFallingPath(arr):
m = len(arr)
n = len(arr[0])
dp = [[0 for i in range(n)] for j in range(2)]
for i in range(n):
dp[0][i] = arr[0][i]
for i in range(1, m):
for j in range(n):
if j == 0:
dp[1][j] = min(dp[0][j], dp[0][j + 1]) + arr[i][j... | StarcoderdataPython |
61771 | <reponame>tdriggs/TetrisAI
import os, json, subprocess
from pathlib import WindowsPath
def get_data_filenames(num_outputs):
output_depth = {
41: 1,
81: 2,
121: 3,
161: 4,
201: 5,
241: 6
}[num_outputs]
return (WindowsPath("../training_data/uber_x_1__%s__%d.cs... | StarcoderdataPython |
3206024 |
def test_player():
from filers2.recording import FilersPlayer
player = FilersPlayer()
player.clean_up()
| StarcoderdataPython |
3256772 | <filename>VB_Classes/hit_miss.py
import cv2 as cv
import numpy as np
titleWindow = 'Hit_miss.py'
input_image = np.array((
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 255, 255, 255, 0, 0, 0, 255],
[0, 255, 255, 255, 0, 0, 0, 0],
[0, 255, 255, 255, 0, 255, 0, 0],
[0, 0, 255, 0, 0, 0, 0, 0],
[0, 0, 255, 0, 0, 2... | StarcoderdataPython |
3247837 | from datetime import datetime
from onegov.core.orm.mixins import content_property, meta_property
from onegov.form import Form
from onegov.org import _
from onegov.org.forms import LinkForm, PageForm
from onegov.org.models.atoz import AtoZ
from onegov.org.models.extensions import (
ContactExtension, NewsletterExtens... | StarcoderdataPython |
3321809 | <filename>PaddleNLP/Research/ACL2019-KTNET/retrieve_concepts/ner_tagging_squad/tagging.py
# -*- coding: utf-8 -*-
# ==============================================================================
# Copyright 2019 Baidu.com, Inc. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# yo... | StarcoderdataPython |
1732368 | from base64 import b64encode
from tornado_http_auth import DigestAuthMixin, BasicAuthMixin, auth_required
from tornado.testing import AsyncHTTPTestCase
from tornado.web import Application, RequestHandler
credentials = {
'user1': '<PASSWORD>',
'user2': '<PASSWORD>',
}
class BasicAuthHandler(BasicAuthMixin, ... | StarcoderdataPython |
3314727 | <filename>leaf_focus/ocr/prepare/operation.py<gh_stars>0
from logging import Logger
from pathlib import Path
from leaf_focus.ocr.prepare.component import Component
from leaf_focus.support.location import Location
class Operation:
def __init__(self, logger: Logger, base_path: Path):
self._logger = logger
... | StarcoderdataPython |
1671328 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, stat
from stat import S_IRWXU, S_IRWXG, S_IROTH, S_IXOTH
from glob import glob
from distutils.core import setup
from distutils.command.build import build as DistutilsBuild
class ExtendedBuild(DistutilsBuild):
def run(self):
os.system("python s... | StarcoderdataPython |
3277635 | <gh_stars>1-10
# flake8: noqa
metadata = {"apiLevel": "2.7"}
def run(ctx):
ctx.home()
magdeck = ctx.load_module("magneticModuleV2", 1)
magdeck_plate = magdeck.load_labware("nest_96_wellplate_2ml_deep")
trough = ctx.load_labware("usascientific_12_reservoir_22ml", 2)
# Name of H/S might be changed... | StarcoderdataPython |
3269255 | import sys
t = int(sys.stdin.readline().rstrip("\n"))
for _ in range(t):
n = int(sys.stdin.readline().rstrip("\n"))
if n%3==2 or n%9 ==0:
print("TAK")
else:
print("NIE") | StarcoderdataPython |
1742708 | # -*- coding: utf-8 -*-
#
# Copyright 2012 <NAME> (http://jamesthornton.com)
# BSD License (see LICENSE for details)
#
"""
Bulbs supports pluggable clients. This is the Rexster client.
"""
from bulbs.config import Config, DEBUG
from bulbs.registry import Registry
from bulbs.utils import get_logger
# specific to this ... | StarcoderdataPython |
196461 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python [conda env:gis]
# language: python
# name: conda-env-gis-py
# --... | StarcoderdataPython |
69253 | import numpy as np
import pytest
from nlp_profiler.granular_features.numbers import \
NaN, gather_whole_numbers, count_whole_numbers # noqa
text_with_a_number = '2833047 people live in this area'
text_to_return_value_mapping = [
(np.nan, []),
(float('nan'), []),
(None, []),
]
@pytest.mark.parametr... | StarcoderdataPython |
115921 | import functools
class Parity:
"""Bitwise operation
Find the parity
from EPI Ch 1
"""
def __init__(self, x):
self._x = x
def set_x(self, x):
self._x = x
def print_result(fun):
@functools.wraps(fun)
def wrap(self):
result = fun(self)
... | StarcoderdataPython |
1728931 | # Author: bbrighttaer
# Project: masdcop
# Date: 5/13/2021
# Time: 4:34 AM
# File: env.py
from masdcop.agent import SingleVariableAgent
from masdcop.algo import PseudoTree, SyncBB
import numpy as np
class FourQueens:
def __init__(self, num_agents):
self._max_cost = 0
self.domain = [(i, j) for i ... | StarcoderdataPython |
3356702 | import json
import unittest
from tests.constants import TESTING_KEYSTORE_FOLDER, TESTING_TEMP_FOLDER
from raiden_installer.account import Account
from raiden_installer.ethereum_rpc import make_web3_provider
from raiden_installer.network import Network
class AccountBaseTestCase(unittest.TestCase):
def setUp(self... | StarcoderdataPython |
3303410 | <reponame>bdemin/M113_Visualization
from vtk import vtkTextActor
def draw_text(_input):
text_actor = vtkTextActor()
text_actor.SetInput(_input)
text_prop = text_actor.GetTextProperty()
text_prop.SetFontFamilyToArial()
text_prop.SetFontSize(34)
text_prop.SetColor(1,1,1)
text_actor.SetDispla... | StarcoderdataPython |
114498 | <reponame>Microsoft/SkillsExtractorCognitiveSearch
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from collections import defaultdict
import itertools
from pathlib import Path
import srsly
from spacy.lang.en.stop_words import STOP_WORDS
from spacy.language import Languag... | StarcoderdataPython |
69362 | <reponame>Lilja/moto<gh_stars>0
import os
from .models import sns_backends
from ..core.models import base_decorator
region_name = os.environ.get("AWS_DEFAULT_REGION", "us-east-1")
sns_backend = sns_backends[region_name]
mock_sns = base_decorator(sns_backends)
| StarcoderdataPython |
100849 | <reponame>jamesjiang52/Bitwise<gh_stars>0
import bitwise as bw
class TestWire:
def test_Wire(self):
wire = bw.wire.Wire()
assert wire.value == 0
wire.value = 1
assert wire.value == 1
wire.value = 0
assert wire.value == 0
print(wire.__doc__)
print(... | StarcoderdataPython |
28309 | <filename>bin/vigilance-server.py
#!/usr/bin/python3
from prometheus_client import start_http_server, Gauge
import urllib.request
import random
from datetime import datetime
import re
import time
test = False
risks = ["vent violent", "pluie-inondation", "orages", "inondation", "neige-verglas", "canicule", "grand-froi... | StarcoderdataPython |
111304 | from datetime import datetime
import os
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.orm import sessionmaker
from srs_sqlite import db
from srs_sqlite.databases import SrsRecord
from srs_sqlite.uti... | StarcoderdataPython |
12303 | <filename>py3canvas/tests/shared_brand_configs.py
"""SharedBrandConfigs API Tests for Version 1.0.
This is a testing template for the generated SharedBrandConfigsAPI Class.
"""
import unittest
import requests
import secrets
from py3canvas.apis.shared_brand_configs import SharedBrandConfigsAPI
from py3canvas.apis.share... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.