id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
1620229 | <reponame>fwilhe2/system-automation
import shutil
import subprocess
import sys
# Convenience script for running playbooks in interactive containers for debugging purposes
def ansible_playbook_executable():
in_path = shutil.which("ansible-playbook")
if in_path == None:
return "/home/user/.local/bin/an... | StarcoderdataPython |
11314156 | """
This module provides `Sprites` to create animation effects with Paths. For more details see
http://asciimatics.readthedocs.io/en/latest/animation.html
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from asciim... | StarcoderdataPython |
1689596 | from flask import render_template
from backend.common.decorators import cached_public
@cached_public
def gameday() -> str:
return render_template("gameday2.html", webcasts_json={}, default_chat=None)
| StarcoderdataPython |
8123402 | from hubcheck.pageobjects.basepagewidget import BasePageWidget
from hubcheck.pageobjects.basepageelement import Link
from hubcheck.pageobjects.basepageelement import TextReadOnly
class ToolsStatusBase(BasePageWidget):
def __init__(self, owner, locatordict={}):
super(ToolsStatusBase,self).__init__(owner,lo... | StarcoderdataPython |
1948636 | import os, sys
def main():
if len(sys.argv) - 1:
engine(' '.join(sys.argv[1:]))
else:
print(os.path.basename(sys.argv[0]), '<directory>')
def engine(path):
directories = files = 0
for information in os.walk(path):
directories += len(information[1])
files += len(informat... | StarcoderdataPython |
11362410 | <gh_stars>1-10
# -*- coding: utf-8 -*-
### Import required python modules
from gevent import monkey
monkey.patch_all()
import platform
import os
from os import listdir, stat, makedirs, mkdir, walk, remove, pardir
from os.path import (
isdir,
isfile,
join,
splitext,
getmtime,
basename,
nor... | StarcoderdataPython |
202488 | <filename>dictLibrary.py
import collections
defaults = {
"appetizers": "Humans",
"main": "Pizza",
"desert": "Chocolate Cake",
"dink": "Water",
}
def prep_menu(customizations):
return
collections.ChainMap(customizations,defaults)
def print_menu(menu):
for key,value in menu.items():
print("As {k... | StarcoderdataPython |
273514 | <filename>trace_normal_of_matrix.py<gh_stars>1-10
#find the trace and normal of a matrix
import math
row, col = list(map(int,input().split()))
if row != col:
print("Invalid Input")
else:
matrix = []
for r in range(row):
new_list = list(map(int, input().split()))
matrix.append(... | StarcoderdataPython |
9791837 | <reponame>AnnMarieW/dmc-docs<gh_stars>1-10
import dash_mantine_components as dmc
component = dmc.Anchor(
"Dash Mantine Components Announcement",
href="https://community.plotly.com/t/dash-mantine-components/58414",
)
| StarcoderdataPython |
8051282 | from DataStream.ByteStream import ByteStream
from Logic.Player import Player
from Logic.Helpers import Helpers
import random
from DataBase.DataBase import DataBase
class LogicGiveDeliveryItemsCommand:
def encode(self):
# Brawler Randomaizer:
a = 0
i = 0
droppedChr = 0
... | StarcoderdataPython |
5108962 | <filename>bot/core/colours.py
# Future
from __future__ import annotations
# Packages
import discord
MAIN = discord.Colour(0xF1C30F)
RED = discord.Colour(0xF20035)
GREEN = discord.Colour(0x16E037)
| StarcoderdataPython |
379175 | <reponame>arcann/config_wrangler<gh_stars>0
import unittest
import boto3
import moto
from config_wrangler.config_templates.credentials import PasswordSource
from config_wrangler.config_templates.s3_bucket import S3_Bucket, S3_Bucket_Folder
from tests.base_tests_mixin import Base_Tests_Mixin
@moto.mock_s3
class Test... | StarcoderdataPython |
5002502 | import colander
import deform.widget
from pyramid.httpexceptions import HTTPFound
from pyramid.view import view_config
from .models import DBSession, Page
class WikiPage(colander.MappingSchema):
title = colander.SchemaNode(colander.String())
body = colander.SchemaNode(
colander.String(),
wid... | StarcoderdataPython |
1692607 | # 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 u... | StarcoderdataPython |
11315073 | <reponame>risklayer/corona-landkreis-crawler
#!/usr/bin/python3
from botbase import *
_mettmann_a = re.compile(r"([0-9.]+)\sInfizierte\serfasst")
_mettmann_d = re.compile(r"Verstorbene zählt der Kreis (?:damit |demnach |bislang |insgesamt )*([0-9.]*)\.")
_mettmann_g = re.compile(r"([0-9.]+)\sPersonen\sgelten\sals\sgen... | StarcoderdataPython |
5198237 | <reponame>alirezakazemipour/NN-Without-Frameworks<gh_stars>1-10
import numpy as np
from .utils import *
from .activations import *
from .initializers import *
def supported_layers():
return [x.__name__ for x in ParamLayer.__subclasses__()]
class Layer:
def __init__(self):
self.vars = {}
def fo... | StarcoderdataPython |
6672451 | <filename>addons14/project_status/tests/test_status.py
from odoo.tests.common import SavepointCase
class TestProjectStatus(SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.ProjectStatus = cls.env["project.status"]
cls.status = cls.ProjectStatus.create(
... | StarcoderdataPython |
5010512 | import os
from pathlib import Path
import pytest
from dismantle.package import PackageFormat, ZipPackageFormat
def test_inherits() -> None:
assert issubclass(ZipPackageFormat, PackageFormat) is True
def test_grasp_exists(datadir: Path) -> None:
src = datadir.join('package.zip')
assert ZipPackageFormat.g... | StarcoderdataPython |
1601363 | <reponame>NVlabs/torchtrainers<filename>torchtrainers/trainer.py
#
# Copyright (c) 2013-2019 <NAME>. All rights reserved.
# This file is part of torchtrainers (see unknown).
# See the LICENSE file for licensing terms (BSD-style).
#
"""Training-related part of the Keras engine.
"""
import os
import os.path
import sys
i... | StarcoderdataPython |
6429263 | a=input()
s=input()
e,E=s.count('e'),s.count('2')
if e==E:
print("yee")
elif e>E:
print("e")
else:
print("2") | StarcoderdataPython |
256200 | <reponame>KDE/craft-blueprints-kde
import info
from CraftConfig import *
from CraftOS.osutils import OsUtils
class subinfo( info.infoclass ):
def setTargets( self ):
self.versionInfo.setDefaultValues()
self.displayName = "FFmpeg Thumbnailer"
self.description = "FFmpeg-based thumbnail creat... | StarcoderdataPython |
3235652 | <gh_stars>1-10
# Generated by Django 3.0.3 on 2020-02-19 12:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('project_core', '0104_delete_colour'),
m... | StarcoderdataPython |
1717001 | <reponame>ijustlovemath/openaps
from unittest import TestCase
from openaps.glucose.display import Display
class DisplayTestCase (TestCase):
"""
Checks that the display function rounds to the correct number
of significant digits
"""
def test_display_mmol_l(self):
self.assertEqual(D... | StarcoderdataPython |
4823427 | <reponame>jkblume/cosmic-ray
"""This is the command-line program for cosmic ray.
Here we manage command-line parsing and launching of the internal
machinery that does mutation testing.
"""
import itertools
import json
import logging
import os
import pprint
import sys
import docopt_subcommands as dsc
import transducer... | StarcoderdataPython |
4808248 | <gh_stars>0
#!python
# This script is used to rename mp4 files by adding the datetime-hour-minute
# to the filename. This is necessary because some camera manufacturers
# do not add a timestamp and simply name files in sequence (001, 002, ...)
# so you can end up with multiple identically named files when the sequence... | StarcoderdataPython |
8118101 | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import functools
from typing import Dict, Type, Optional, Set, Iterable
from ogr.abstract import GitService, GitProject
from ogr.exceptions import OgrException
from ogr.parsing import parse_git_repo
_SERVICE_MAPPING: Dict[str, Type[GitSer... | StarcoderdataPython |
3414303 | from experiments.research.par_v1 import crnn_data, crnn_script, mevm_with_crnn
from experiments.research.par_v1 import grieggs
| StarcoderdataPython |
8198244 | from dist import *
from local import *
from messages import *
| StarcoderdataPython |
11259785 | <filename>keras_models/models/pretrained/vgg16_places365.py
# -*- coding: utf-8 -*-
'''VGG16-places365 model for Keras
This code is forked from: https://github.com/GKalliatakis/Keras-VGG16-places365/blob/master/vgg16_places_365.py
To be re-wrote in Keras way in future.
# Reference:
- [Places: A 10 million Image Databa... | StarcoderdataPython |
5165913 | from flask import render_template, url_for, redirect, request, flash
from unolocum.amzn_form import UrlForm
from unolocum import app
from bs4 import BeautifulSoup
import requests
from unolocum.sql import cur, conn
from mysql.connector.errors import DataError
from datetime import datetime
# global variables
... | StarcoderdataPython |
3318596 | import numpy as np
import os, logging
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
logging.getLogger("tensorflow").setLevel(logging.CRITICAL)
logging.getLogger("tensorflow_hub").setLevel(logging.CRITICAL)
import keras as K
import tensorflow as tf
import copy
import warnings
class batchless_VanillaLSTM_keras(object):
"... | StarcoderdataPython |
6630134 | # os.system("bash command") 运行shell命令,直接显示
# os.popen("bash command).read() 运行shell命令,获取执行结果
# os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径
# os.chdir("dirname") 改变当前脚本工作目录;相当于shell下cd
import os
# 统计文件的大小
# os.path.getsize('路径') # python的命令
# dir 路径 \C # 操作系统的命令
# 帮助你显示当前路径下的所有文件和文件夹
# os.system('dir 路径') # 使用python... | StarcoderdataPython |
9766807 | <reponame>asaf-kali/generic-iterative-stemmer<filename>generic_iterative_stemmer/training/stemming/default_stem_generator.py
from typing import Optional
import editdistance
from ...training.stemming import StemDict, StemGenerator
from ...utils import get_logger
log = get_logger(__name__)
class DefaultStemGenerator... | StarcoderdataPython |
1825953 | from .msdnet import MSDNet as msdnet
| StarcoderdataPython |
11292301 | class DatasetConfig:
__DATASET_KEY = 'dataset'
__DATASET_PATH_KEY = 'path'
__ANOMALY_COL_KEY = 'is_anomaly_column'
__SUBSPACE_COL_KEY = 'subspace_column'
__dataset_json_obj = None
def __init__(self):
pass
@staticmethod
def setup(config_json_obj):
DatasetConfig.__datase... | StarcoderdataPython |
3415961 | <filename>packages/service-library/tests/aiohttp/conftest.py<gh_stars>0
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from pathlib import Path
from typing import Dict
import pytest
from servicelib.aiohttp.openapi import create_openapi_specs
@pytest.fixture
def petstore_spec_file(here) -> ... | StarcoderdataPython |
4906177 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 14 11:14:11 2019
Starting point is loading in the pickled class data, then working with it
to create subsetted trees: a list of trees that have e.g. 5 children underneath
Then can take a random pick of a person with (e.g.) 5 people beneath,
create a list of all the child... | StarcoderdataPython |
8049957 | <gh_stars>0
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2021 Neongecko.com Inc.
# BSD-3
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided... | StarcoderdataPython |
6579671 | <gh_stars>1-10
import unittest
from hypothesis import given
from electionguard.group import ElementModQ
from electionguard.hash import hash_elems
from tests.property.test_group import elements_mod_p, elements_mod_q
class TestHash(unittest.TestCase):
@given(elements_mod_p(), elements_mod_q())
def test_same_a... | StarcoderdataPython |
4871155 | # -*- coding: utf-8 -*-
#
# Copyright 2018-2021 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | StarcoderdataPython |
3509081 | <gh_stars>1-10
import pygame,sys
from opensimplex import OpenSimplex
mainClock = pygame.time.Clock()
from pygame.locals import *
pygame.mixer.pre_init(44100, -16, 2, 512)
pygame.init() # initiates pygame
pygame.mixer.set_num_channels(64)
pygame.event.set_allowed([QUIT, KEYDOWN, KEYUP,MOUSEBUTTONDOWN])
pygame.... | StarcoderdataPython |
3588223 | import os, re, openpyxl
from openpyxl import load_workbook
wb1 = load_workbook("test/D04.xlsx")
wb2 = load_workbook("test/20200414SOE.xlsx")
ws11 = wb1['資料']
ws21 = wb2['AI_LIST']
ws22 = wb2['DI-1-SOE-MCD']
ws23 = wb2['DI-2-1BIT-2BIT']
ws24 = wb2['CO_LIST']
index = 0
index2 = 0
index3 = 0
for i in range(2,ws11.max_ro... | StarcoderdataPython |
1616623 | #coding:utf8
import logging
import json
from base_handler import BaseHandler
from utils import decimal_default,get_linenumber
from utils import RoundDown
from .proxy import EthereumProxy
from constants import ETH_IP_ADDR,ETH_RPC_PORT,ETH_BLK_BUFFER_SIZE
import sql
from constants import ERC20_CONTRACTS_MAP #ERC20合约... | StarcoderdataPython |
3574952 | <reponame>AlexandrosKyriakakis/StochasticProcesses<filename>Lab5_2020/simple_markov_chain_lib.py
from bisect import bisect_left
from random import random
import networkx as nx # get communication classes
import numpy as np
from scipy.sparse import csr_matrix
class markov_chain:
def __init__(self, markov_table,... | StarcoderdataPython |
284724 | furryshit = ["Rawr x3",
"nuzzles",
"how are you",
"pounces on you",
"you're so warm o3o",
"notices you have a bulge o:",
"someone's happy :wink:",
"nuzzles your necky wecky~ murr~",
"hehehe rubbies your bulgy wolgy",
"you're so big :oooo ",
"rubbies more on your bulgy w... | StarcoderdataPython |
1848570 | <gh_stars>1-10
import unittest
import requests
class UnitTestsIbanfoxAPI(unittest.TestCase):
# https://ibanfox.com/docs/api-reference/#operation/validateIban
def test_get_validateIban(self):
print('test_get_validateIban')
headers = {
'x-api-key': '',
}
response = ... | StarcoderdataPython |
3583511 | <reponame>PseudotsugaMenziesii/e-napalm
from collections import Counter
from flask_login import current_user
from git import Repo
from io import BytesIO
from logging import info
from os import environ
from sqlalchemy import and_
from subprocess import Popen
from threading import Thread
from uuid import uuid4
from werkz... | StarcoderdataPython |
6418520 | #
# Solution to Project Euler problem 55
# Copyright (c) Project Nayuki. All rights reserved.
#
# https://www.nayuki.io/page/project-euler-solutions
# https://github.com/nayuki/Project-Euler-solutions
#
def compute():
ans = sum(1 for i in range(10000) if is_lychrel(i))
return str(ans)
def is_lychrel(n):
for i... | StarcoderdataPython |
82555 | <reponame>schnusch/nimble2nix
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p git nim nix-prefetch-git python3Packages.packaging
import argparse
import contextlib
from functools import cache
import itertools
import json
import logging
import os
import shlex
import subprocess
import sys
import tempfile
import urllib.... | StarcoderdataPython |
4804714 | <reponame>jungyoonoh/baekjoon-1
# Authored by : cieske
# Co-authored by : -
# Link : http://boj.kr/4c2449f200e440f39d4ba8e1e71601b6
import sys
def input():
return sys.stdin.readline().rstrip()
n, k = map(int, input().split())
coin = set([int(input()) for _ in range(n)]) #중복 동전 제거
dp = [0]*(k+1)
for i in range(1,... | StarcoderdataPython |
250854 | from __future__ import absolute_import
from .. import idiokit
from ..xmlcore import Element
from .jid import JID
DISCO_INFO_NS = "http://jabber.org/protocol/disco#info"
DISCO_ITEMS_NS = "http://jabber.org/protocol/disco#items"
class DiscoItem(object):
def __init__(self, jid, node=None, name=None):
self.... | StarcoderdataPython |
9717427 | <filename>env_check.py
# Script Name : env_check.py
# Author : <NAME>
# Created : 14th May 2012
# Last Modified : 14 February 2016
# Version : 1.0.1
# Modifications : 1.0.1 - Tidy up comments and syntax
# Description : This script will check to see if all of the environment variables I require ... | StarcoderdataPython |
1923835 | <gh_stars>0
from django.db import models
class Color(models.Model):
name = models.CharField('色', max_length=10)
class Apple(models.Model):
name = models.CharField('品種', max_length=50)
color = models.ForeignKey('sort_app.Color', on_delete=models.CASCADE)
breeding = models.CharField('交配', max_length=1... | StarcoderdataPython |
4892380 | <reponame>badouralix/adventofcode-2018<gh_stars>10-100
from tool.runners.python import SubmissionPy
class BebertSubmission(SubmissionPy):
def run(self, s):
dependencies = [line.split(" ") for line in s.splitlines()]
dependencies = [(d[1], d[7]) for d in dependencies]
tasks = {}
f... | StarcoderdataPython |
5029149 | import unittest
from mock import MagicMock, call
from malcolm.core import Context
from malcolm.modules.ADPandABlocks.parts import PandABlocksDriverPart
class TestPandaABoxDriverPart(unittest.TestCase):
def setUp(self):
self.child = MagicMock()
self.context = MagicMock(spec=Context)
self.... | StarcoderdataPython |
1791995 | from core import misc
def load_modules():
try:
misc.loader.load_package('private.modules')
except (ImportError, ModuleNotFoundError):
pass
misc.loader.load_packages(f"modules.{item}" for item in [
'base', # User management and base Middlewares
'nologi', # Plotim plotim
... | StarcoderdataPython |
4886330 | <reponame>levtelyatnikov/radiomixer
from radiomixer.sampler.segment.segment_samplers import EqualSegmentSampler
from radiomixer.sampler.segment.segment import SegmentGenerator
from radiomixer.transforms.transform import TransformType
class EqualSegmentSamplerWrapper(SegmentGenerator):
def __init__(self, confi... | StarcoderdataPython |
6700868 | <filename>specifications/migrations/0002_categoryspecifications.py
# Generated by Django 3.1.7 on 2021-05-28 12:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0002_auto_20210524_1449'),
('specificatio... | StarcoderdataPython |
322778 | <filename>word2vec/nlp/tokenizer.py<gh_stars>0
import re
UNK = "<UNK"
def naive_tokenizer(s):
return re.split(r"\s", s.strip())
| StarcoderdataPython |
1746860 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'x1ang.li'
import logging, os, argparse, textwrap
import time
import chardet
# Default configuration will take effect when corresponding input args are missing.
# Feel free to change this for your convenience.
DEFAULT_CONF = {
# Only those files ending w... | StarcoderdataPython |
6545795 | """
VerseBot for Slack
By <NAME>
Adapted from VerseBot for Reddit by <NAME>
Copyright (c) 2016 <NAME> (MIT License)
"""
import asyncio
import websockets
import json
import signal
import logging
import time
import re
from slacker import Slacker
import sys
import threading
import books
import webparser
from regex impo... | StarcoderdataPython |
5049627 | <gh_stars>1-10
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def averageOfLevels(self, root):
"""
:type root: TreeNode
:rtype: List[float]
... | StarcoderdataPython |
78232 | <filename>non_semantic_speech_benchmark/eval_embedding/finetune/models_test.py<gh_stars>1-10
# coding=utf-8
# Copyright 2022 The Google Research 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 ... | StarcoderdataPython |
6632984 | from __future__ import division, print_function, absolute_import
from numpy.testing import assert_equal, assert_
from scipy.misc import pade, logsumexp, face, ascent
from scipy.special import logsumexp as sc_logsumexp
from scipy.interpolate import pade as i_pade
def test_logsumexp():
# make sure logsumexp can b... | StarcoderdataPython |
3254104 | <reponame>migvill5/pharmanager<filename>src/inventory/migrations/0009_auto_20210524_1601.py
# Generated by Django 3.1.7 on 2021-05-24 21:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('inventory', '0008_auto_20210524_1600'),
]
operations = [
... | StarcoderdataPython |
5057519 | <gh_stars>10-100
# -*- coding: utf-8 -*-
from .base import XmlServiceTransport
from .database import DatabaseTransport
from .direct import DirectTransport
from .http import HttpTransport
from .ssh import SshTransport
__all__ = [
'XmlServiceTransport',
'DatabaseTransport',
'DirectTransport',
'HttpTransp... | StarcoderdataPython |
229928 | __author__ = 'sharvey'
| StarcoderdataPython |
167014 | <gh_stars>1-10
from __future__ import unicode_literals
import frappe
def execute():
frappe.rename_doc('DocType', 'Account Type', 'Bank Account Type', force=True)
frappe.rename_doc('DocType', 'Account Subtype', 'Bank Account Subtype', force=True)
frappe.reload_doc('accounts', 'doctype', 'bank_account') | StarcoderdataPython |
5171287 | from src import OpCode
from src import Statement
from src import Type
from src import VoidOp
from utils.patched_dataclass import dataclass
@dataclass
class OpExtension(OpCode, VoidOp):
name: str = None
@dataclass
class OpExtInstImport(OpCode):
name: str = None
@dataclass
class OpExtInst(Statement):
ty... | StarcoderdataPython |
4832376 | __author__ = 'mehdibenchoufi'
| StarcoderdataPython |
9616275 | <filename>Influxdb2MagicBlue.py
# -*- coding: utf-8 -*-
from magicbluelib import MagicBlue
import matplotlib.pyplot as plt
import time
import numpy as np
import sys, getopt
from influxdb import InfluxDBClient
__author__ = '<EMAIL>'
def cmap2hex(mag=0.5,cmax=1,cmin=0,cmap='jet'):
color = plt.get_cmap(cmap)
#no... | StarcoderdataPython |
5023291 | #!/usr/bin/env python
# imrt.py
import numpy as num
from satvap import satvap
from integral import integral
def imrt(alt,temp,rh):
"""imt = imrt(alt,temp,rh)
compute integrated mean radiating temperature
= Integral(p_h2o / T) / Integral(p_h2o / T^2)
Inputs:
alt : altitude profile in km
temp : temperature... | StarcoderdataPython |
371548 | <reponame>jbaumann/attiny_daemon
import logging
import os
import sys
import time
import smbus
import struct
from typing import Tuple, Any
from configparser import ConfigParser
from argparse import ArgumentParser, Namespace
from collections.abc import Mapping
from pathlib import Path
class ATTiny:
REG_LAST_ACCESS ... | StarcoderdataPython |
1921408 | from django_elasticsearch_model_binder.mixins import ESQuerySetMixin
from django_elasticsearch_model_binder.models import ESBoundModel
from django_elasticsearch_model_binder.utils import ExtraModelFieldBase
__all__ = ['ESBoundModel', 'ESQuerySetMixin', 'ExtraModelFieldBase']
| StarcoderdataPython |
1861779 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from nltk.stem.snowball import SnowballStemmer
from base import BaseObject
stemmer = SnowballStemmer("english", ignore_stopwords=False)
class EntityDictGenerator(BaseObject):
def __init__(self, some_df):
"""
Updated:
12-Apr-2017
... | StarcoderdataPython |
3221276 | <gh_stars>0
import requests
import json
import csv
from collections import deque
import time
import datetime
def getsince(csv_file):
with open(csv_file,'r') as f:
return deque(csv.reader(f),1)[0][0]
def getprices():
#urlbfx='https://api.bitfinex.com/v2/candles/trade:1m:tLTC... | StarcoderdataPython |
6481668 | <filename>djbr/urls.py
from django.conf.urls import url
from . import views
app_name = 'djbr'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^book/(?P<book_id>[0-9]+)/$', views.book, name='book'),
url(r'^book/(?P<book_id>[0-9]+)/reviews/$', views.reviews, name='reviews'),
url(r'^book/(?... | StarcoderdataPython |
5072468 | from .EKSSOneHundredPlantsMarginPipeline import EKSSOneHundredPlantsMarginPipeline
from .GRASTAAutoMPGPipeline import GRASTAAutoMPGPipeline
from .GRASTAAutoPricePipeline import GRASTAAutoPricePipeline
from .KSSOneHundredPlantsMarginPipeline import KSSOneHundredPlantsMarginPipeline
from .OWLRegressionAutoPricePipeli... | StarcoderdataPython |
276668 | <filename>mythril/ethereum/interface/rpc/constants.py
"""This file contains constants used used by the Ethereum JSON RPC
interface."""
BLOCK_TAG_EARLIEST = "earliest"
BLOCK_TAG_LATEST = "latest"
BLOCK_TAG_PENDING = "pending"
BLOCK_TAGS = (BLOCK_TAG_EARLIEST, BLOCK_TAG_LATEST, BLOCK_TAG_PENDING)
| StarcoderdataPython |
4817288 | import time
from mw import api
from ..types import StateMarker, Timestamp
from ..types.events import Event, Match
class RCListener:
def __init__(self, session, *, state_marker, events,
max_wait, rcs_per_request, stop):
self.session = session
self.state_marker... | StarcoderdataPython |
195591 | from __future__ import absolute_import, division, print_function
from trakt.core.errors import ERRORS
class RequestFailedError(Exception):
pass
class RequestError(Exception):
def __init__(self, response):
self.response = response
self.status_code = response.status_code if response is not No... | StarcoderdataPython |
11248516 | <reponame>tomsinger/TimeInc-Radeks-LeavingCard
from __future__ import unicode_literals
import hashlib
import os
import errno
import codecs
import zipfile
import shutil
import glob
import subprocess
from chardet.universaldetector import UniversalDetector
from ftfy import fix_file
def get_hash(file_handler):
md5 =... | StarcoderdataPython |
12846217 | <gh_stars>1-10
from fastapi import Request
class MockedHTTPRequest(Request):
def __init__(self, body: dict = {}, headers: dict = {}):
super().__init__({"type": "http"})
self.__body = body
self.__headers = headers
@property
def body(self) -> dict:
return self.__body
@p... | StarcoderdataPython |
11279472 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Polygon:
def get_min_max(self,coordinates):
min_x = None
min_y = None
max_x = None
max_y = None
for i in range(len(coordinates)):
for j in range(len(coordinates[i])):
actual_x = coordinates[i][... | StarcoderdataPython |
12850807 | <reponame>IVIGOR13/print_chat<gh_stars>1-10
#
# Author: <NAME>
# 2019
#
import time
import os
from termcolor import colored
from datetime import datetime
import colorama
colorama.init()
"""
Small print tool for implementing chat in the terminal
"""
class print_chat:
def _clear_screen(self):
os.system('c... | StarcoderdataPython |
9720778 | #!/usr/bin/env python
#
# soaplib - Copyright (C) Soaplib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any late... | StarcoderdataPython |
1721606 | <reponame>blackbotinc/AWS-Attack<filename>ttp/src/cloudtrail_download_event_history_src.py
#!/usr/bin/env python3
import datetime
import argparse
import json
import time
def main(args, awsattack_main):
session = awsattack_main.get_active_session()
print = awsattack_main.print
get_regions = awsattack_mai... | StarcoderdataPython |
1966460 | # density processing classes and functions
import numpy as np
import matplotlib.pyplot as plt
# define class
class Density(object):
"""Data over time for one or more positions.
Attributes
----------
t : time in units of [s]
d : density in units of [kg/m^3]
p : the name of the locations
""... | StarcoderdataPython |
8179849 | <reponame>Botomatik/JackBot
#!/usr/bin/python
"""
Script to extract all wiki page names a certain HTML file points to in
interwiki-link format
The output can be used as input to interwiki.py.
This script takes a single file name argument, the file should be a HTML file
as captured from one of the wikipedia servers.
... | StarcoderdataPython |
5066727 | from netapp.netapp_object import NetAppObject
class LunSnapUsageLunInfo(NetAppObject):
"""
Details of the LUN backed by specified snapshot.
"""
_path = None
@property
def path(self):
"""
Path of the LUN.
"""
return self._path
@path.setter
def path(se... | StarcoderdataPython |
12859997 | from unittest import TestCase
from leetcodepy.edit_distance import *
solution1 = Solution1()
word11 = "horse"
word12 = "ros"
expected1 = 3
word21 = "intention"
word22 = "execution"
expected2 = 5
class TestEditDistance(TestCase):
def test1(self):
self.assertEqual(expected1, solution1.minDistance(wo... | StarcoderdataPython |
9645660 | <filename>doit/api.py<gh_stars>1000+
"""Definition of stuff that can be used directly by a user in a dodo.py file."""
import sys
from doit.cmd_base import ModuleTaskLoader
from doit.doit_cmd import DoitMain
def run(task_creators):
"""run doit using task_creators
@param task_creators: module or dict containi... | StarcoderdataPython |
3380119 | <reponame>rajansh87/Algorithms-Implementations<filename>HASHING/2 sum.py
arr=[2,7,11,15]
target=9
if len(arr)<2:
print([])
hashtable={}
temp=[]
for i in range(len(arr)):
j=target-arr[i]
if j in hashtable.keys():
temp=[hashtable[j]+1,i+1]
hashtable[arr[i]]=i
print(temp)
| StarcoderdataPython |
11262266 | <filename>mitm/extra/data_processor/out_socket/data_processor/group.py
from mitm.extra.data_processor.out_socket.data_processor import DataProcessor
class DataProcessorGroup(DataProcessor):
def __init__(self, *processors):
self.processors = processors
def process(self, string):
for processor ... | StarcoderdataPython |
8178059 | """add ip_addr column
Revision ID: 353ae4db3695
Revises: 80a54752ff01
Create Date: 2018-02-17 03:01:59.381491
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '353ae4db3695'
down_revision = '80a54752ff01'
branch_labels = None
depends_on = None
def upgrade():
... | StarcoderdataPython |
4840330 | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url('^home$', views.home, name='offline.home'),
url('^stub$', views.stub, name='offline.stub'),
)
| StarcoderdataPython |
9662262 | <filename>src/wrappers/python/pygroupsig/blindsig.py
from _groupsig import lib, ffi
from . import constants
import base64
def blindsig_export(sig):
"""
Exports the given blinded signature to a Base64 string.
Parameters:
sig: The blinded signature to export.
Returns:
The produced Ba... | StarcoderdataPython |
3527960 | <reponame>mocobk/pymock<gh_stars>1-10
# -*- coding:utf-8 -*-
# __auth__ = mocobk
# email: <EMAIL>
import setuptools
with open("README.md", "r", encoding='utf-8') as fh:
long_description = fh.read()
setuptools.setup(
name="py-mock",
version="1.2.1",
author="mocobk",
author_email="<EMAIL>",
d... | StarcoderdataPython |
4939203 | from sw_data_loader.SWDataClassFile import SWData
print("run home")
data = SWData()
data.load_img_datafiles("I:/RES/TestFolder")
print(data.base_path)
print((len(data.data_classes)))
print(data.is_datafiles_all_same_dim()) | StarcoderdataPython |
4848288 | <reponame>JasonKarle/rpi_weather
#!/usr/bin/env python
"""
This is the core program enabling the local weather and date and time
to be read for a location and parsed. This is intended to provide
the base data to then be graphically displayed on a RPi 3" LCD screen,
which will (may) be executed in a separate module
"""... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.