id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
9608954 | <filename>Python/TimeSeries/redeem_prediction.py
import matplotlib.pylab as plt
import pandas as pd
from statsmodels.tsa.stattools import adfuller
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
import numpy as np
import sys
from statsmodels.tsa.arima_model import ARMA
# 差分操作,d代表差分序列,比如[1,1,1]可以代表3阶差分。 ... | StarcoderdataPython |
4975208 | <gh_stars>0
"""Compute and write Sparameters using Meep in MPI."""
import multiprocessing
import pathlib
import pickle
import shlex
import subprocess
import sys
import time
from pathlib import Path
from typing import Optional
import pydantic
import gdsfactory as gf
from gdsfactory.component import Component
from gds... | StarcoderdataPython |
9774847 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class DjangaeConfig(AppConfig):
name = 'djangae'
verbose_name = _("Djangae")
def ready(self):
from .patches.contenttypes import patch
patch()
| StarcoderdataPython |
8163548 | from django.db import models
from django.conf import settings
from utils.models.abstract import DatetimeCreatedModel
class Todo(DatetimeCreatedModel):
"""Our todo model."""
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
related_name="todos"
)
tit... | StarcoderdataPython |
12865042 |
import numpy as np
from sklearn.neural_network import MLPRegressor
from sklearn.exceptions import NotFittedError
from inter.interfaces import QLearning
from utility import set_all_args
class NFQ(QLearning):
gamma = 0.9
beta = 0.8
def __init__(self, **kwargs):
self.mlp = MLPRegressor(
... | StarcoderdataPython |
383563 | """Clowder command line link controller
.. codeauthor:: <NAME> <<EMAIL>>
"""
import argparse
import clowder.util.formatting as fmt
from clowder.clowder_controller import print_clowder_name
from clowder.git.clowder_repo import ClowderRepo, print_clowder_repo_status
from clowder.environment import clowder_repo_requir... | StarcoderdataPython |
4973668 | from styx_msgs.msg import TrafficLight
import numpy as np
import tensorflow as tf
import rospy
class TLClassifier(object):
def __init__(self, site = False):
#TODO load classifier
self.loaded = False
if site:
pass
else:
self.detection_graph = self.load_graph('ssd_inception.pb')
s... | StarcoderdataPython |
377770 | #!/usr/bin/env python3
import math
import time
def main():
digits = [int(x) for x in str(math.factorial(100))]
print("Solution:", sum(digits))
if __name__ == "__main__":
start = time.time()
main()
end = time.time()
print("Duration: {0:0.6f}s".format(end - start))
| StarcoderdataPython |
5025230 | #!/usr/bin/env fontforge -lang=py -script
# -*- coding: utf-8 -*-
#
# converted font format otf to ttf. (add gasp table).
#
# need: mkdir ttf
# all convert: ls -1 | grep .otf | xargs -I{} fontforge --script font_extra.py {}
import fontforge
import sys
import os
def get_gasp():
return (
(8, ('antialias',)),
(... | StarcoderdataPython |
4981702 | <filename>grocery/products/admin.py
from django.contrib import admin
from .models import Product, Category, Offer
# Register your models here.
admin.site.register(Product)
admin.site.register(Category)
admin.site.register(Offer)
| StarcoderdataPython |
1634143 | #!/usr/bin/python3
# Author: @AgbaD | @Agba_dr3
def missing(arr):
a = sorted(arr)
x = max(a)
for i in range(1, x):
if i not in a:
return i
return x+1
if __name__ == "__main__":
arr1 = [3, 4, -1, 1]
arr2 = [1, 2, 0]
print(missing(arr1))
print(missing(arr2))
| StarcoderdataPython |
8162715 | <gh_stars>1000+
"""
Candlestick Chart
=================
A candlestick chart inspired from `Protovis <http://mbostock.github.io/protovis/ex/candlestick.html>`_.
This example shows the performance of the Chicago Board Options Exchange `Volatility Index <https://en.wikipedia.org/wiki/VIX>`_ (VIX)
in the summer of 2009. ... | StarcoderdataPython |
221922 | #-*- coding:utf-8 -*-
__author__ ="https://github.com/mskhrk"
import os
from cfg_api import *
my_dir=os.path.dirname(__file__)
cfg_name='test.cfg'
cfg_path=my_dir+'\\'+cfg_name
work_dir='C:/Users/user/Desktop'
teaget_dir='C:/Users/user/Desktop'
teaget_dir2='C:/Users/user/Desktop/ttr'
#讀取指定目錄的檔案
#cfg_rea... | StarcoderdataPython |
3582693 | <filename>python/python-odata-try.py
from odata import ODataService
#import pdb;pdb.set_trace()
url = 'http://services.odata.org/V4/Northwind/Northwind.svc/'
Service = ODataService(url, reflect_entities=True)
Supplier = Service.entities['Supplier']
query = Service.query(Supplier)
query = query.limit(2)
query = query... | StarcoderdataPython |
4875344 | # DEPRECATED - this file is dead, and should be removed by the end of the redesign project
from portality.formcontext.formhelper import FormHelperBS3
from portality.formcontext.choices import Choices
from copy import deepcopy
class Renderer(object):
def __init__(self):
self.FIELD_GROUPS = {}
self.... | StarcoderdataPython |
1754504 | <reponame>Andre-Williams22/SPD-2.31-Testing-and-Architecture
def binary_search(arr, element, low=0, high=None):
"""Returns the index of the given element within the array by
performing a binary search.
"""
if high == None:
high = len(arr) - 1
if high < low:
return -1
... | StarcoderdataPython |
60335 | # Python imports
# Third party imports
import boto3
# Self imports
class DjangoCloudWatchHandler:
def __init__(
self,
log_level: str,
log_group_name: str,
cloud_watch_aws_id: str,
cloud_watch_aws_key: str,
cloud_watch_aws_region: str,
) -> None:
sel... | StarcoderdataPython |
252498 | import bs4
from ...travparse import parsebuild
from . import building
# Точка сбора
class RallyPoint(building.Building):
def __init__(self, village_part, name, id, level):
building.Building.__init__(self, village_part, name, id, level)
self.eng_name = 'rallypoint'
def post(self, url, params,... | StarcoderdataPython |
6410197 | # coding: utf-8
from __future__ import annotations
import collections.abc
import os
import string
import itertools
import more_itertools
import dateparser
import ebooklib
import ebooklib.epub
import fitz
from contextlib import suppress
from io import StringIO
from functools import cached_property, lru_cache
from pathl... | StarcoderdataPython |
12801486 | # Author: <NAME>
# 14 Feb 2019
# HPCC Brandeis
#This code will
#1) All files inside a given path that have not been accessed/modified/group_changed in the last threshod days
#2) Create a report of user owners and their deleted files
import os, time, datetime
import pwd
import sys
clear = lambda: os.system('clear'... | StarcoderdataPython |
8032842 | <reponame>1kko/ezDHLoader<gh_stars>0
import PySimpleGUI as sg
import pafy
from urllib.parse import urlparse, parse_qs
import time
import random
import configparser
import os
def output_callback(total, recvd, ratio, rate, eta):
global progress_bar
try:
# print(recvd, ratio, eta)
progress_bar.Up... | StarcoderdataPython |
3295070 | #-*- coding: utf-8 -*-
import json, ast
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext
from uni_form.helpers import FormHelper, Submit, Reset
from django.contrib.auth.decorators import login_required
from oauth... | StarcoderdataPython |
9662219 | # -*- coding: utf-8 -*-
import hoaxlyHelpers
import scrapyelasticsearch
# Scrapy settings for Hoaxlyspiders project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/setti... | StarcoderdataPython |
9723161 | <reponame>DarkSkull777/Anime-DL-Bot
# Copyright © 2021 BaraniARR
# Encoding = 'utf-8'
# Licensed under MIT License
# Special Thanks for gogoanime
from pyrogram import *
from pyrogram.types import *
import requests
from requests_html import HTMLSession
from bs4 import BeautifulSoup
# Splits Inline buttons into ranges ... | StarcoderdataPython |
1778792 | from pylab import *
import numpy as np
from scipy.io.netcdf import netcdf_file
def make_plot(DIR_INP, FILTER, CUTS, nBin):
MCwant = FILTER['MCwant']
fgap = FILTER['fgap']
WangFlag = FILTER['WangFlag']
FNAME = 'MCflag%s_%dbefore.%dafter_fgap%1.1f' % (MCwant, nBin['before'], nBin['after... | StarcoderdataPython |
6466055 | <reponame>benjohnsonnlp/robosquirt
import logging
from django.apps import AppConfig
class GeoConfig(AppConfig):
logger = logging.getLogger("moistmaster")
name = 'geo'
| StarcoderdataPython |
1872361 | from __future__ import absolute_import, print_function, division
from functools import partial
from itertools import product
import numpy as np
from six.moves import xrange
from theano import tensor as T
import theano
import theano.tensor.tests.test_extra_ops
from theano.tensor.extra_ops import CumOp
from theano.tes... | StarcoderdataPython |
1780185 | class Config(object):
ENVIRONMENT = None
DEBUG = False
TESTING = False
| StarcoderdataPython |
188319 | __author__ = 'frederico'
# exercício 8
from random import randint
lista1 = ['e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'e10']
# from revisao1 import lista1
# exercício 9
print(randint(0,9))
# exercício 10
lista2 = ['e11', 'e12', 'e13', 'e14', 'e15', 'e16', 'e17', 'e18', 'e19', 'e20']
# exercício 11
# pr... | StarcoderdataPython |
5080782 | import numpy
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
ext = Extension('truncated_norm_C', sources=['truncated_norm_C.pyx', 'truncated_normal.c'],
include_dirs=[numpy.get_include()])
setup(ext_modules=[ext]... | StarcoderdataPython |
6515818 | from .jointsl2loss import JointsL2Loss | StarcoderdataPython |
3552134 | # Question 3
# Given an undirected graph G, find the minimum spanning tree within G.
# A minimum spanning tree connects all vertices in a graph with the smallest possible total weight of edges.
# Your function should take in and return an adjacency list structured like this:
# {'A': [('B', 2)],
# 'B': [('A', 2),... | StarcoderdataPython |
103726 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | StarcoderdataPython |
1997735 | <filename>src/tasks.py
# https://www.cloudamqp.com/docs/celery.html
import celery, os, requests, json, tasks, fb, states, apiai
from intents import *
#_post_msg_url = 'https://graph.facebook.com/v2.6/me/messages?access_token='+os.environ['FBOT_ACCESS_TOKEN']
app = celery.Celery('demo')
app.conf.update(
BROKER_U... | StarcoderdataPython |
1635864 | # This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from affine import Affine
from odc.geo import CRS, geom
from odc.geo.geobox import (
GeoBox,
bounding... | StarcoderdataPython |
1928778 | <reponame>pateldevang/TensorDash<filename>tensordash/tensordash.py
import requests
import json
import tensorflow as tf
import getpass
import time
class FirebaseError(Exception):
pass
class SendDataToFirebase(object):
def __init__(self, key = None):
response = None
def signin(self, email = None, p... | StarcoderdataPython |
12850200 | import argparse
import hail as hl
from gnomad.utils.vep import (
process_consequences,
filter_vep_to_canonical_transcripts,
get_most_severe_consequence_for_summary,
CSQ_CODING_HIGH_IMPACT,
CSQ_CODING_MEDIUM_IMPACT,
CSQ_CODING_LOW_IMPACT,
CSQ_NON_CODING,
)
from hail.genetics import reference... | StarcoderdataPython |
4989831 | <filename>parsercode/daedcode/process_archive.py
"""
Process all logs in archive
Only need to use this if rebuilding draws.txt
Writes to draws_debug.txt
"""
import glob
import os
import parsercode.utils as utils
if __name__ == '__main__':
utils.Log('Starting\n')
# Clear the debug file.
f = open('draw... | StarcoderdataPython |
3576723 | # disable visual plots
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import pystan
from scipy.stats.distributions import cauchy, norm, t as student_t
import arviz as az
import pickle
import gzip
from datetime import datetime
import os
stime = datetime.now()
print("Starting:... | StarcoderdataPython |
306808 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'socker_server_window.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
... | StarcoderdataPython |
9753626 |
with open('tokens.txt', 'r') as f:
for l in f.readlines():
l = l.strip()
if l == "":
continue
print("{}: \"{}\",".format(l, l))
| StarcoderdataPython |
3273528 | <filename>wsi_3/game/locals.py
"""CONSTANS"""
WIDTH, HEIGTH = 800, 800
ROWS, COLS = 8, 8
SQUARE_SIZE = WIDTH // COLS
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
YELLOW = (255, 255, 0)
WHITE = (255, 255, 255)
| StarcoderdataPython |
1917697 | import re
file = open('./input', 'r')
lines = file.readlines()
lines = list(map(lambda line: line[:-1], lines))
def list_to_string(l):
s = ''
for c in l: s += c
return s
ids = []
for line in lines:
row_raw = line[:7]
col_raw = line[7:]
row_bin = list_to_string(list(map(lambda c: '0' if c == 'F' else '1'... | StarcoderdataPython |
3213273 | <filename>test/minermedic_002_mining_pools_test.py<gh_stars>1-10
# minermedic_002_mining_pools_test.py, Copyright (c) 2019, Phenome Project - <NAME> <<EMAIL>>
import sys
from phenome.test import BaseTest
from phenome.test.supporting.test_mockobject import MockObject
from minermedic.pools.helper import process_pool_a... | StarcoderdataPython |
1844062 | #!/usr/bin/env python3.8
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Produces a representation of the dependencies between Banjo libraries.'''
import argparse
import copy
import json
import re
import... | StarcoderdataPython |
1729890 | import logging
import codecs
import re
from sortedcontainers import SortedSet
from dse.cqlengine import columns
from dse.cqlengine.models import Model
from dse import ConsistencyLevel
from nltk.corpus import stopwords
class SearchVideo():
def __init__(self, user_id, added_date, video_id, name, preview_image_locat... | StarcoderdataPython |
399021 | <gh_stars>0
from rest_framework import serializers
from api.models.device import Device
from api.models.order import Order
from django.contrib.auth.models import User
class UserSerializer(serializers.ModelSerializer):
devices = serializers.PrimaryKeyRelatedField(many=True, queryset=Device.objects.all())
orders... | StarcoderdataPython |
1729052 | <filename>scraper/main.py<gh_stars>0
#principal functions
from data import Amazon, Ebay, Mercado_Libre, Best_Buy, headers
from scrape_funcs import extract_soup, search_boxes
from page_getters import get_names, get_images, get_products_urls, get_price
# Clasification info
from clasificator import add_clasificatio... | StarcoderdataPython |
12826444 | <filename>bgkube/bg.py
from six import add_metaclass
from time import sleep
from bgkube import cmd, registries
from bgkube.api import KubeApi
from bgkube.run import Runner
from bgkube.errors import ActionFailedError
from bgkube.utils import output, log, timestamp, require, get_loadbalancer_address, is_host_up
class ... | StarcoderdataPython |
33763 | from gherkin_to_markdown.expressions.expression import Expression
class SecondHeaderExpression(Expression):
def to_markdown(self, statement: str):
return f"##{statement.strip().replace(':', '', 1)[len(self.keyword):]}\n\n"
| StarcoderdataPython |
12818368 | <gh_stars>10-100
import cv2
import numpy as np
from python_path import PythonPath
from tqdm import tqdm
with PythonPath("."):
from afy.predictor_local import PredictorLocal
from afy.utils import Once, log, crop, pad_img, resize, TicToc
from afy.utils import load_stylegan_avatar
config_path = "fomm/config... | StarcoderdataPython |
5131579 | from PyQt5 import QtGui
from hackedit.api import events
from hackedit.app import settings
from hackedit.api.widgets import PreferencePage
from hackedit.app.forms import settings_page_notifications_ui
class Notifications(PreferencePage):
"""
Preference page for the application notifications settings
"""
... | StarcoderdataPython |
1718151 | '''tzinfo timezone information for Pacific/Fiji.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Fiji(DstTzInfo):
'''Pacific/Fiji timezone definition. See datetime.tzinfo for details'''
zone = 'Pacific/Fiji'
_utc_tra... | StarcoderdataPython |
3550248 | <filename>src/auspex/parameter.py
# Copyright 2016 <NAME>
#
# 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
from auspex.log import logger
cla... | StarcoderdataPython |
9726160 | from main.app import db
from flask_login import UserMixin
# The User model stores information about a human user. A user is identified by a user name or email address.
class User(UserMixin, db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key = True)
user_name ... | StarcoderdataPython |
5194543 | <gh_stars>1-10
from meli_challenge.core import CharactersGraph, SparkClient
from meli_challenge.core.input import CsvInput
from tests.utils import assert_dataframe_equality, create_df_from_collection
client = SparkClient()
client.create_session()
def test_core_top_interactions(spark_context, spark_session):
# ar... | StarcoderdataPython |
218418 | import functools
from abc import ABC, abstractmethod
from collections import Callable
from event_bus import EventBus as SimpleEventBus
class EventBus(ABC):
@abstractmethod
def subscribe_func_to_event(self, func: Callable, event_name: str) -> None:
raise NotImplementedError
@abstractmethod
d... | StarcoderdataPython |
3528954 |
nums = list(range(0,60))
for num in nums:
print("<option value=\""+str(num)+"\">"+str(num)+"</option>") | StarcoderdataPython |
8048703 | <gh_stars>0
import unittest
from ..argumentpickers import ArgumentByNamePicker, ArgumentByNameError
class TestArgumentByNamePicker(unittest.TestCase):
def test_it_can_pick_argument_by_name(self):
picker = ArgumentByNamePicker("b")
args = (1,2,3,4)
kwargs = {}
def func(a,b,c,d): pass
self.assert... | StarcoderdataPython |
5128079 | <filename>pyrestorm/exceptions/http.py<gh_stars>1-10
# HTTP Class Exceptions
class HttpException(Exception):
pass
class ServerErrorException(HttpException):
# HTTP 500
pass
class MethodNotAllowedException(HttpException):
# HTTP 405
pass
class NotFoundException(HttpException):
# HTTP 404
... | StarcoderdataPython |
85487 | ##
# File: NEFImportTests.py
# Date: 06-Oct-2018 <NAME>
#
# Updates:
##
"""Test cases for NEFTranslator - simply import everything to ensure imports work"""
import unittest
import sys
if __package__ is None or __package__ == "":
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__f... | StarcoderdataPython |
3397487 | <filename>modules/components/variables_panel.py
from .. typecheck import *
from .. import core
from .. import ui
from .. import dap
from .. debugger.breakpoints import Breakpoints
from .. debugger.watch import Watch, WatchView
from . variable_component import VariableStateful, VariableStatefulComponent
from . layout i... | StarcoderdataPython |
3547525 | <filename>Componenttesting/GUItest.py
import tkinter as tk
a = False
def Run():
global a
if a != True:
a = True
slogan.configure(bg="red",text = "STOP")
else:
a = False
slogan.configure(bg="white",text = "RUN")
print(a)
return a
root = tk.Tk(className = 'My b... | StarcoderdataPython |
6464557 |
import codecs
import logging
import sys
import requests
from massweb.targets.target import Target
from massweb.proxy_rotator.proxy_rotate import get_random_proxy
logging.basicConfig(format='%(asctime)s %(name)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
logger = logging.getLogger('pnknet')
logger.setLevel(loggi... | StarcoderdataPython |
3395431 | <gh_stars>10-100
import fastscapelib_fortran as fs
import numpy as np
import xsimlab as xs
from .boundary import BorderBoundary
from .erosion import TotalErosion
from .grid import UniformRectilinearGrid2D
from .main import SurfaceTopography
from .tectonics import TectonicForcing
@xs.process
class BaseIsostasy:
"... | StarcoderdataPython |
6502896 | from typing import Optional
from fastapi import Depends, HTTPException, Path
from starlette.status import HTTP_404_NOT_FOUND
from app.api.dependencies.authentication import get_current_user_authorizer
from app.api.dependencies.database import get_repository
from app.db.errors import EntityDoesNotExist
from app.db.rep... | StarcoderdataPython |
1688562 | #
# This file is implemented based on the author code of
# Lee et al., "A simple unified framework for detecting out-of-distribution samples and adversarial attacks", in NeurIPS 2018.
#
import os
import torch
import numpy as np
def compute_confscores(model, test_loader, outdir, id_flag):
total = 0
if id_fl... | StarcoderdataPython |
6515788 | <reponame>AndreasArne/redovisnings-sida<gh_stars>0
"""
Fixtures for integration tests
"""
# pylint: disable=redefined-outer-name,unused-argument
import pytest
@pytest.fixture
def user_dict():
"""
Dictionary with user data
"""
data = {
"username": "doe",
"password": "<PASSWORD>",
... | StarcoderdataPython |
4872624 | """Test build file."""
| StarcoderdataPython |
1685974 | import getpass
import logging
import os
import subprocess
import sys
from typing import List
import verboselogs
from openpyn import __basefilepath__, root
verboselogs.install()
logger = logging.getLogger(__package__)
credentials_file_path = __basefilepath__ + "credentials"
def check_credentials() -> bool:
retu... | StarcoderdataPython |
11265643 | """The schema.org Person model.
For reference see schema.org: https://schema.org/Person
"""
from dataclasses import dataclass
from . import Thing
@dataclass
class Person(Thing):
"""
The schema.org Person model
Attributes
----------
additionalName
Text
An additional name for a Per... | StarcoderdataPython |
11261356 | # -*- coding:utf-8 -*-
import sys
import os
import argparse
from paths import *
# Mean color to subtract before propagating an image through a DNN
MEAN_COLOR = [103.062623801, 115.902882574, 123.151630838]
parser = argparse.ArgumentParser(description='Train or eval SSD model with goodies.')
# The name of your exper... | StarcoderdataPython |
11307951 | import csv
import lxml.html
import login
session = login.session
class Page():
def __init__(self, url):
self.url = url
self.response = session.get(url)
self.root = lxml.html.fromstring(self.response.content)
def top_index():
"""Have manually checked: this is complete for categoryname... | StarcoderdataPython |
305547 | import srmanager.sr
srm = srmanager.sr.SR()
top = srm.get_topology()
#for n in top:
# for l in top[n]:
# print "{} node, {} link, {} src-tp".format(n,l,top[n][l]['source-tp'])
srm.del_all_flows(top)
srm.add_sr_flows(top)
srm.listen_to_topology()
| StarcoderdataPython |
357517 | from qtpy.QtCore import QModelIndex, Qt, QAbstractItemModel
from qtpy.QtGui import QPainter
from qtpy.QtWidgets import QStyledItemDelegate, QStyleOptionViewItem, QWidget, QLineEdit
class LineEditDelegate(QStyledItemDelegate):
"""Custom editing delegate that allows renaming text and updating placeholder text in a ... | StarcoderdataPython |
6400045 | <reponame>BasicBeluga/flask-oauth2-login<gh_stars>10-100
import os
from flask import Flask, jsonify
from flask_oauth2_login import GoogleLogin
app = Flask(__name__)
app.config.update(
SECRET_KEY="secret",
GOOGLE_LOGIN_REDIRECT_SCHEME="http",
)
for config in (
"GOOGLE_LOGIN_CLIENT_ID",
"GOOGLE_LOGIN_CLIENT_SEC... | StarcoderdataPython |
6400166 | <filename>peppermynt/cmds/__init__.py<gh_stars>0
#!/usr/bin/env python
from .generate import Generate, Gen
from .serve import Serve
from .watch import Watch
| StarcoderdataPython |
1693862 | <reponame>oevseev/resistance-bot
import logging
import random
from enum import Enum
from typing import Dict, List, Optional
import telegram
MIN_PLAYERS, MAX_PLAYERS = 5, 10
# Party size per round for every possible player count
PARTY_SIZES = {
5: [2, 3, 2, 3, 3],
6: [2, 3, 4, 3, 4],
7: [2, 3, 3, 4, 4],
... | StarcoderdataPython |
1794594 | import factory
import pytest
from django.contrib.auth.models import User
from factory import fuzzy
from faker import Faker
from recipes.models import Category, Recipe
pytestmark = pytest.mark.django_db
Faker.seed(0)
faker = Faker(["pt_BR"])
class AuthorFactory(factory.django.DjangoModelFactory):
class Meta:
... | StarcoderdataPython |
3440912 | <reponame>nik-sm/meta-dataset
# coding=utf-8
# Copyright 2019 The Meta-Dataset Authors.
#
# 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
#
# ... | StarcoderdataPython |
397476 | <reponame>Xtansia/Discorgeous
from .configuration.general import Configuration as GeneralConfiguration
from .configuration.client import Configuration as ClientConfiguration
from .configuration.server import Configuration as ServerConfiguration
from .client import Client
| StarcoderdataPython |
1826877 | <filename>stub/__init__.py
from stub.main import display
__all__ = ['display']
| StarcoderdataPython |
288444 | <reponame>lumapps/lumapps-sdk
class InvalidLogin(Exception):
pass
| StarcoderdataPython |
9655571 | import itertools
import numpy as np
from ..normalizations import linear_normalization
from ..distance_metrics import euclidean
from .mcda_method import MCDA_method
class CODAS(MCDA_method):
def __init__(self, normalization_method = linear_normalization, distance_metric = euclidean, tau = 0.02):
"""
... | StarcoderdataPython |
8038500 | # -*- coding: utf-8 -*-
from django.contrib.admin.utils import prepare_lookup_value
from django.contrib import admin
from django.db.models import Q
from django.utils.encoding import force_text
from django.utils.translation import gettext_lazy as _
from django.contrib.admin.utils import reverse_field_path
from django.co... | StarcoderdataPython |
76539 | <reponame>animeshpatcha/automation<gh_stars>0
import logging
import sys
import logging.handlers
from scapy.all import *
import pprint
import json
def print_packets(pcap):
# For each packet in the pcap process the contents
# Print out the timestamp in UTC
pkt_structure = {}
pcap_dict = {}
pkt_counte... | StarcoderdataPython |
9682735 | <filename>DJITelloPy/examples/manual_control_pygame.py
from djitellopy import Tello
import cv2
import pygame
import numpy as np
import time
from robomaster import robot
from tkinter import *
from tkinter import messagebox
# Speed of the drone
# 无人机的速度
S = 60
# Frames per second of the pygame window display
# A low num... | StarcoderdataPython |
4930030 | <reponame>ATrain951/01.python-com_Qproject<gh_stars>1-10
#!/bin/python3
#
# Complete the kMarsh function below.
#
def kMarsh(grid):
#
# Write your code here.
#
rows = len(grid)
cols = len(grid[0])
up = [[0] * cols for _ in range(rows)]
left = [[0] * cols for _ in range(rows)]
for i in ... | StarcoderdataPython |
3519144 | <filename>ExPy/ExPy/module53.py
"""Todo List"""
import sqlite3
def list_notes():
"""List Notes"""
with sqlite3.connect("module53.db") as connection:
cursor = connection.execute("select id, note from notes")
notes = cursor.fetchall()
for (id, note) in notes:
print(id, ":"... | StarcoderdataPython |
8168535 | <reponame>OpendataCH/froide
from django.conf import settings
from django.urls import include, path, re_path
from django.utils.translation import pgettext_lazy
from ..views import AttachmentFileDetailView, auth, project_shortlink, search, shortlink
from . import (
account_urls,
list_requests_urls,
make_requ... | StarcoderdataPython |
35232 | #this file contains models that I have tried out for different tasks, which are reusable
#plus it has the training framework for those models given data - each model has its own data requirements
import numpy as np
import common_libs.utilities as ut
import random
import torch.nn as nn
import torch.autograd as autograd... | StarcoderdataPython |
6514588 | import setuptools
import versioneer
requirements = [
# package requirements go here
]
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='openff-spellbook',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Handy functionali... | StarcoderdataPython |
283064 | import logging
import pytest
from python_ci_cd_sample.log import (
create_logger,
log_return,
log_exception,
inject_logger,
LogError,
)
_LOGGER1 = "test_logger1"
_LOGGER2 = "test_logger2"
_NOT_EXISTS_LOGGER = "test_logger_not_exists"
_EXCEPTION_LOGGER = "test_exception_logger"
create_logger(_LOG... | StarcoderdataPython |
4839780 | <reponame>vsverchinsky/conan-recipes<filename>breakpad/0.1/conanfile.py
from conans import ConanFile, CMake, AutoToolsBuildEnvironment, tools
class BreakpadConan(ConanFile):
name = "breakpad"
license = "https://chromium.googlesource.com/breakpad/breakpad/+/refs/heads/master/LICENSE"
url = "https://github.... | StarcoderdataPython |
9631826 | <reponame>tuxtof/calm-dsl
"""
Calm DSL Runbook Sample for input task
"""
from calm.dsl.runbooks import runbook, runbook_json
from calm.dsl.runbooks import RunbookTask as Task, RunbookVariable as Variable
code = """print "Hello @@{user_name}@@"
print "Your Password is @@{password}@@"
print "Date you selected is @@{d... | StarcoderdataPython |
1973198 | from dynoup import ma
from scaler.models import Check, App
class CheckSchema(ma.Schema):
id = ma.UUID(dump_only=True)
app_id = ma.UUID(dump_only=True)
dynotype = ma.Str(dump_only=True)
class Meta:
model = Check
fields = ('id', 'app_id', 'url', 'params', 'dynotype')
class AppSchema(m... | StarcoderdataPython |
3437816 | <gh_stars>0
"""
Inference
---------
Module description
"""
import warnings
from abc import ABC, abstractmethod
from collections.abc import Iterable
import chainer
import chainer.functions as F
import numpy as np
from tqdm import tqdm
from brancher.optimizers import ProbabilisticOptimizer
from brancher.variables impor... | StarcoderdataPython |
11300783 | <gh_stars>0
import processing
import os
import sys
def process_geotag_properties(import_path,
geotag_source="exif",
geotag_source_path=None,
offset_time=0.0,
offset_angle=0.0,
... | StarcoderdataPython |
4846470 | '''
Represents an order in the draw request from DataTables.js.
'''
class DrawRequestOrder:
def __init__(self, column, direction):
self.column = column
self.direction = direction
def __repr__(self):
return "Ord(column=%s, direction=%s)" % (self.column, self.direction)
__str__ = __rep... | StarcoderdataPython |
45794 | <gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020-2021 Jetperch LLC
#
# 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/LICENS... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.