id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
1725224 | <filename>stable_world/commands/auth.py<gh_stars>0
import click
from stable_world.interact.setup_user import setup_user
from stable_world import utils, application
from stable_world.interact.setup_user import setup_bucket_token
@click.group()
def main():
pass
@main.command()
@application.email_option
@applicati... | StarcoderdataPython |
93032 | #!/usr/bin/env python3
import flask
import os
from PIL import Image, ImageFilter
import hashlib
import FileMimetypes as mime
app = flask.Flask(__name__)
app.jinja_env.trim_blocks = True
RELEASE_VERSION = '1.0.0'
app.config['APPLICATION_NAME'] = 'AutoGalleryIndex'
app.config['ROW_ITEMS_SHORT'] = 3
app.config['ROW_I... | StarcoderdataPython |
5079977 | # See bazel/README.md for details on how this system works.
CONTRIB_EXTENSIONS = {
#
# HTTP filters
#
#
# Network filters
#
"envoy.filters.network.kafka_broker": "//contrib/kafka/filters/network/source:kafka_broker_config_lib",
"envoy.filters.network.kafka_mesh": ... | StarcoderdataPython |
9663778 | <reponame>ahkarimi/MMTOD<gh_stars>0
from flask import Flask, request, jsonify, render_template, session
import os
import pickle
import datetime
import time
import pandas as pd
import numpy as np
import random
import logging
##__________________________________ GPT-3 code __________________________________________##
f... | StarcoderdataPython |
5131148 | <reponame>adlibre/adlibre-monitoring<gh_stars>0
"""
Adlibre Deployment Script for CentOS / EL 5/6 / Amazon AMI
All commands should be idempotent
"""
from fabric.api import env, run, put, sudo, prefix
from fabric.contrib.files import append, comment, exists, sed
def _get_os_major_version():
""" Helper function ... | StarcoderdataPython |
4947842 | <gh_stars>0
from tkinter import *
from tkinter import ttk
import tkinter as tk
from tkinter.scrolledtext import ScrolledText
from tkinter.font import Font
class LikeSettings():
def __init__(self,gui_frame):
self.settings_tab = gui_frame
likes_today_text = tk.Label(self.settings_tab, text="max. L... | StarcoderdataPython |
18242 | <filename>nnutils/laplacian_loss.py
# --------------------------------------------------------
# Written by <NAME> (https://github.com/JudyYe)
# --------------------------------------------------------
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
# Copyrig... | StarcoderdataPython |
9790269 | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( s ) :
n = len ( s )
a = [ 0 ] * n
for i in range ( n - 1 , - 1 , - 1 ) :
back_up = 0
fo... | StarcoderdataPython |
29150 | # receive_msg.py
#
# SPDX-FileCopyrightText: Copyright 2021 <NAME>
#
# SPDX-License-Identifier: MIT
#
# Receive message from IOTA tangle
#
import iota_client
import os
import pprint
# Config
msg_meta = False
env_node_address = 'HORNET_NODE_ADDRESS'
# Print Message data
def show_message(message, meta=False):
if... | StarcoderdataPython |
386841 | <reponame>appetito/2checkout_demo<gh_stars>0
import hashlib
from .twocheckout import Twocheckout
class Passback(Twocheckout):
def __init__(self, dict_):
super(self.__class__, self).__init__(dict_)
@classmethod
def check_hash(cls, params=None):
m = hashlib.md5()
m.update(params['sec... | StarcoderdataPython |
5047303 | from .detector import detect_faces
from .visualization_utils import show_results
from .align_trans import get_reference_facial_points, warp_and_crop_face
| StarcoderdataPython |
4951940 | # Created byMartin.cz
# Copyright (c) <NAME>. All rights reserved.
# import modules
import wx
import wx.dataview as wxdv
from .. import mwx
from .. import events
from .list_model import AuthorsListModel
class AuthorsList(wx.Panel):
"""Authors list panel."""
def __init__(self, parent):
""... | StarcoderdataPython |
11386701 | <filename>main.py
from textblob import TextBlob
import tweepy
import sys # This module is part of the core Python stack.
import math # This module is part of the core Python stack.
from dotenv import load_dotenv
from pathlib import Path
import os
env_path = Path(".env") ... | StarcoderdataPython |
270753 | <filename>instances/migrations/0002_alter_instance_url.py
# Generated by Django 4.0.1 on 2022-01-18 19:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('instances', '0001_initial'),
]
operations = [
migrations.AlterField(
m... | StarcoderdataPython |
1928233 | import pytest
import src.user_class
import src.database_access
def resetFunctions():
src.user_class.input = input
src.user_class.print = print
class TestIsPasswordSecure:
page = src.user_class.Page()
def test_password_character_limit_lower(self):
assert self.page.is_password_secure("P2$s") ... | StarcoderdataPython |
9789927 | from .framework import (
selenium_test,
SeleniumTestCase
)
class WorkflowManagementTestCase(SeleniumTestCase):
ensure_registered = True
@selenium_test
def test_import_from_url(self):
self.workflow_index_open()
self._workflow_import_from_url()
table_elements = self.workfl... | StarcoderdataPython |
3570745 | <filename>pde_superresolution/xarray_beam.py
# Copyright 2018 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | StarcoderdataPython |
8120155 | from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('experiments', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ExperimentKeyValue',
fields=[
... | StarcoderdataPython |
5068624 | <gh_stars>0
################################################################################
# Copyright (c) 2009-2020, National Research Foundation (SARAO)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the Lice... | StarcoderdataPython |
4957816 | """
Objects for cast.py tests
"""
class OldBase:
def __init__(self, v):
self.v = v
class Target(OldBase):
pass
class NewBase:
pass
| StarcoderdataPython |
3204175 | """Modelling classes for Make 13 Lolo game mode."""
import tile_generators
__author__ = "<NAME> and <NAME>"
__copyright__ = "Copyright 2017, The University of Queensland"
__license__ = "MIT"
__version__ = "1.1.2"
import model
import game_regular
from modules.weighted_selector import WeightedSelector
class LevelTile... | StarcoderdataPython |
3583898 | from logger import logger
from mathtools import floor_div
"""A base class that implements the algorithms and minimum settings"""
def e(a: int, b: int):
"""
Euclidean algorithm(GCD) - An effective algorithm for finding the greatest common divisor of two integers
:param a: int first value
:param b: in... | StarcoderdataPython |
4883221 | <gh_stars>0
#
# Copyright (c), 2021, Quantum Espresso Foundation and SISSA (Scuola
# Internazionale Superiore di Studi Avanzati). All rights reserved.
# This file is distributed under the terms of the MIT License. See the
# file 'LICENSE' in the root directory of the present distribution, or
# http://opensource.org/lic... | StarcoderdataPython |
4907119 | #!/usr/bin/env python
"""
This module provides MigrationBlock.Update data access object.
"""
from dbs.dao.Oracle.MigrationBlock.Update import Update as OraMigUpdate
class Update(OraMigUpdate):
pass
| StarcoderdataPython |
5082964 | # class Solution:
# def decodeString(self, s: str) -> str:
# pool = set('0123456789')
# stack = []
# for char in s:
# if char != ']':
# stack.append(char)
# else:
# chars = ''
# while stack[-1] != '[':
# ... | StarcoderdataPython |
5160106 | <filename>pybind/nos/v7_1_0/brocade_maps_ext_rpc/__init__.py
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, R... | StarcoderdataPython |
4904841 | <gh_stars>1-10
import torch
import torch.utils.data as Data
BATCH_SIZE = 5
def show_batch(loader):
for epoch in range(3):
for step, (batch_x, batch_y) in enumerate(loader):
# training
print("step:{}, batch_x:{}, batch_y:{}".format(step, batch_x, batch_y))
if __name__ == '__main__... | StarcoderdataPython |
1778951 | <gh_stars>0
from test import test
from test import h1
from test import h2 | StarcoderdataPython |
5053431 | <gh_stars>1000+
"""
raven.transport.base
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
# Helper for external transports
has_newstyle_transports = True
class Transport(object):
... | StarcoderdataPython |
11263013 | <gh_stars>1-10
from abc import ABC, abstractmethod
from time import sleep
from typing import Dict
from attrdict import AttrDict
from web3 import Web3
from .helpers import NOW, factor_in_new_try, validate_required_fields_interactively, validate_required_fields, \
set_dict_field
class Issuer:
"""A basic versi... | StarcoderdataPython |
8155796 | <gh_stars>0
import folium
from geopy.exc import GeocoderUnavailable
from geopy.geocoders import Nominatim
from flask import Flask, render_template, request, url_for, flash, redirect
from twitter2 import get_friends
def create_map(friends: list) -> None:
"""creates html file with locations of your twitter friends
... | StarcoderdataPython |
8176067 | from tkinter import StringVar, IntVar
DEFAULT_TRAIN_DIR = '../experiments/train_0_4'
DEFAULT_DELAY_MS = 0
DEFAULT_NUM_GAMES = 1
DEFAULT_SHOW_GAMES = False
class Config(object):
"""
All options that are set in the Main GUI (see window.py) can be accessed in this class.
"""
def __init__(self, mast... | StarcoderdataPython |
9650984 | from functools import reduce
from .homogeneous import Translation, UniformScale, Rotation, Affine, Homogeneous
def transform_about_centre(obj, transform):
r"""
Return a Transform that implements transforming an object about
its centre. The given object must be transformable and must implement
a metho... | StarcoderdataPython |
362861 | <reponame>NymanRobin/crl-interactivesessions<gh_stars>1-10
"""Robot Framework variable file for robottests.
This is variable file for docker-robottests cluster"""
import os
import sys
__copyright__ = 'Copyright (C) 2019-2020, Nokia'
PYTHON_MAJOR = sys.version_info.major
def get_port(target):
envpy = 'PY{}'.f... | StarcoderdataPython |
1873772 | import numpy as np
import pandas as pd
import random
def prob_to_samplenum(total_num, prob_list):
"""
Transfer a list of probability
"""
sample_num_list = []
for each_prob in prob_list:
sample_num_list.append(round(total_num * each_prob))
while sum(sample_num_list) < total_num:
... | StarcoderdataPython |
190775 | # Copyright (c) Scrapy developers.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of condition... | StarcoderdataPython |
1870668 | <filename>tests/test_dsci532_group12.py<gh_stars>1-10
from dsci532_group12 import dsci532_group12
| StarcoderdataPython |
1807241 | <reponame>tomstitt/PyMFEM<filename>mfem/_ser/mesh_operators.py
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_i... | StarcoderdataPython |
4856846 | <filename>src/gausskernel/dbmind/tools/predictor/python/settings.py<gh_stars>0
"""
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVID... | StarcoderdataPython |
9774281 | <reponame>Yif-Yang/pytorch-SimSiam
import torch
import torch.nn as nn
import math
# from models.resnet import resnet50
from torchvision.models import resnet50
import torch.nn.functional as F
def D(p, z, version='original'): # negative cosine similarity
if version == 'original':
z = z.detach() # stop gradien... | StarcoderdataPython |
1681659 | <reponame>Exdenta/torchsat
from pathlib import Path
import math
import numpy as np
import pytest
import tifffile
import torch
from PIL import Image
from torchsat.transforms import transforms_cls
tiff_files = [
'./tests/fixtures/different-types/tiff_1channel_float.tif',
'./tests/fixtures/different-types/tiff_... | StarcoderdataPython |
8010044 | <gh_stars>0
#!/usr/bin/env python3
from termolator_fact_txt import *
def main(args):
## infile is the output file from distributional term extraction
infile = args[1]
file_type = args[2]
if not file_type.lower() in ['.htm','.html','.txt','.hml','.xml','.xhtml','.sgm','.sgml','.xhml']:
... | StarcoderdataPython |
11252772 | <gh_stars>0
from comments.serializers.populated import PopulatedNestedCommentSerializer
from group_members.serializers.populated import PopulatedUsersMemberSerializer
from projects.serializers.common import ProjectSerializer
from ..serializers.common import DetailTicketSerializer, TicketSerializer
from jwt_auth.seriali... | StarcoderdataPython |
11371576 | import unittest
from MapperSwitch import MapperSwitch
from Wiring import Wiring
class TestMapperSwitch(unittest.TestCase):
def setUp(self):
self.wiringCfg={
"0": [
0
],
"1": [
2,0
],
"2": [
1,0
... | StarcoderdataPython |
12859224 | <filename>tests/data/demo-project/demo/c/d.py
def e():
print("This is function e in file d!")
class E:
def __init__(self):
self.content = "This is class E in file d"
def print(self):
print(self.content)
| StarcoderdataPython |
3513921 | <gh_stars>0
import re
count=0
num=[]
name = input("Enter file:")
if len(name) < 1 : name = "sum.txt"
handle = open(name)
words=list()
#hour=list()
for line in handle :
line=handle.read()
y=re.findall('[0-9]+',line)
print(len(y))
list_of_floats = []
for item in y:
list_of_floats.append(fl... | StarcoderdataPython |
1635199 | <gh_stars>1-10
#MenuTitle: Toggle Axis 3
# -*- coding: utf-8 -*-
__doc__="""
Toggles along masters across the 1st axis in current tab.
"""
from Foundation import NSUserDefaults, NSString
font = Glyphs.font
tab = font.currentTab
selectedMaster = font.selectedFontMaster
theAxisIndex = 3 # toggle across axis number
th... | StarcoderdataPython |
11336732 | <reponame>mberkay0/wounderful
from django import forms
from .models import UploadImage
from crispy_forms.helper import FormHelper
class UploadImageForm(forms.ModelForm):
helper = FormHelper()
helper.form_show_labels = True
class Meta:
model = UploadImage
fields = [
'images',
... | StarcoderdataPython |
3581182 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'DataFitting.ui'
#
# Created by: PyQt5 UI code generator 5.12
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainW... | StarcoderdataPython |
11205536 | <gh_stars>1-10
import re
black = ['à', 'di', 'au', 'aux', 'des', 'l', 'sous', 'et', 'du', 'les', 'd', 'lès', 'la', 'le', 'en', 'de', 'sur', 'saint', 'sainte']
# Adelans-et-le-Val-de-Bithaine -> Adelans-et-le-Val-de-Bithaine, adelans-et-le-val, adelans
# Return full name first
def subpart_generator(name):
if '-' not... | StarcoderdataPython |
386780 | #!/usr/bin/env python
#coding:utf-8
#########################################################################################################################
## Version : 0.0.7-1
## Developer : Yannyann (https://github.com/a2d8a4v)
## Website : https://www.yannyann.com
## License : MIT License
########################... | StarcoderdataPython |
3520063 | <gh_stars>1-10
fileref = open("olympics.txt","r") # open file olympics.txt to read only
contents = fileref.read() # is going to bring in the entire contents
#of the file as a single string
print(contents[:100])
fileref.seek(0) # rewind fileref
lines ... | StarcoderdataPython |
1947112 | """
scope.py
the code in this file is meant to demonstrate how variable scope
works in python 3.8. When writing this code, I referred to the Python 3.8
documentation to ensure that I was using the correct technical vocabulary
in my own documentation, but all code written is my own.
Doc pages I referred to:
Exec... | StarcoderdataPython |
180093 | from __future__ import annotations
from pathlib import Path
from typer import echo
from ..resolvers import clone_github, clone_local
from .resolver import Resolver
from .runner import Runner
from .variables import get_variables, read_variables
class NooCore:
def __init__(self, allow_shell: bool = False) -> Non... | StarcoderdataPython |
11312066 | <reponame>Mulham/Django-Project
# Generated by Django 3.2.3 on 2021-05-31 00:37
import books.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0004_auto_20210530_2358'),
]
operations = [
migrations.AlterField(
... | StarcoderdataPython |
1801071 | <reponame>mklewitz-kisura/dotfiles<gh_stars>0
"""
The :mod:`jedi.api.classes` module contains the return classes of the API.
These classes are the much bigger part of the whole API, because they contain
the interesting information about completion and goto operations.
"""
import warnings
import re
from jedi._compatibi... | StarcoderdataPython |
158412 | <gh_stars>10-100
"""ebsd module to manipulate Electron Back Scattered data sets."""
import h5py
import numpy as np
import os
from pymicro.crystal.microstructure import Orientation
from pymicro.crystal.lattice import Symmetry, CrystallinePhase, Lattice
class OimPhase(CrystallinePhase):
"""A class to handle a phase... | StarcoderdataPython |
1717079 | <gh_stars>0
from typing import List, Optional, Union
from pydantic import BaseModel
try:
from typing import Literal # type: ignore
except ImportError:
from typing_extensions import Literal
VERSION = 1
class Model(BaseModel):
class Config:
extra = "forbid"
class Variable(Model):
name: st... | StarcoderdataPython |
6637452 | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
# Examples:
url(r'^$', 'example_basic.translate.views.hello', name='hello'),
url(r'^apples$', 'example_basic.translate.views.apples', name='apples'),
url(r'^apples/python$', 'example_basic.translate.views.pythoni... | StarcoderdataPython |
3221062 | <gh_stars>10-100
"""Script for generating the ACHIEVEMENTS.md file, which is a human-readable
version of the PRs json record.
"""
import argparse
import dataclasses
import json
import pathlib
import sys
import datetime
from typing import List
import jinja2
from sorald._helpers import jsonkeys
ENCODING = "utf8"
TEMP... | StarcoderdataPython |
3206767 | from cell_models import kernik, paci_2018, protocols
from scipy.interpolate import interp1d
import numpy as np
class ModelTarget():
"""
protocol – type from protocols
model – initialize Paci or Kernik model
target_type – Spontaneous, Voltage clamp, paced, SAP
tr – trace object
"""
def __i... | StarcoderdataPython |
369824 | <gh_stars>1-10
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# tcp_socket_client.py
# chsocket
#
# 🎂"Here's to the crazy ones. The misfits. The rebels.
# The troublemakers. The round pegs in the square holes.
# The ones who see things differently. They're not found
# of rules. And they have no respect for the stat... | StarcoderdataPython |
1703942 | <filename>IsoperimetricUnittests.py
import unittest
import Isoperimetric
from sympy import var, pi
from sympy.functions import exp, log, cos
# import SPCVUnittests
from Isoperimetric import t, x, x_diff
C1 = Isoperimetric.Isoperimetric.C1
C2 = Isoperimetric.Isoperimetric.C2
lambda_0 = Isoperimetric.Isoperimetric.lambd... | StarcoderdataPython |
4936468 | # coding: Latin-1
# Copyright © 2018 The Things Network
# Use of this source code is governed by the
# MIT license that can be found in the LICENSE file.
import unittest
import ttn
from ttn.utils import stubs
class TestHandlerClient(unittest.TestCase):
def setUp(self):
self.handler = ttn.HandlerClient(s... | StarcoderdataPython |
3501128 | <gh_stars>10-100
"""Main script to output accuracy statistics and other benchmarks of the inference pipeline.
.. code-block:: console
$ python -m chesscog.report.prepare_recognition_results --help
usage: prepare_recognition_results.py [-h] [--results RESULTS]
[--datas... | StarcoderdataPython |
1839102 | <filename>python/demo.py<gh_stars>10-100
# demo.py
#
# This example script show how to process image in the GPU via
# python, numpy, pyimagej and clij.
#
# Author: <NAME>, <EMAIL>
# August 2019
#######################################################3333
# init pyimage to get access to jar files
import imagej
i... | StarcoderdataPython |
130971 | <filename>src/data/warehouse.py
import collections
import time
_DATA = collections.ChainMap()
_HISTORY = [_DATA]
_DEADLINE_MS = 10
def register(path, value):
if path in _DATA.maps[0]:
raise KeyError('%s already specified' % path)
_DATA[path] = value
def get(path):
value = _DATA[path]
if callable(value)... | StarcoderdataPython |
9706301 | import random
class FloatField(object):
def __init__(self, width:int, height:int, defaultValue:float = 0, _data = None):
self.width = width
self.height = height
if _data:
self.data = _data
else:
self.data = self.__createField(width, height, defaultValue)
#
def __createField(self, width:int, height... | StarcoderdataPython |
1606736 | """
Unit test for selection operators.
"""
import random
from math import nan
import numpy as np
import pytest
from leap_ec import Individual
from leap_ec import ops, statistical_helpers
from leap_ec.binary_rep.problems import MaxOnes
from leap_ec.data import test_population
from leap_ec.real_rep.problems import ... | StarcoderdataPython |
9678593 | <reponame>wafec/wafec-tests-openstack-stub
import psutil
import unittest
from wafec_tests_openstack_stub._configuration import interception_config
from wafec_tests_openstack_base.interception import generate_key
from wafec_tests_openstack_stub.interception import Interception
interception_config.dat_file = "../../res... | StarcoderdataPython |
9639844 | <reponame>jaraco/pycoreutils
from ..exception import ExtraOperandException
import calendar
import time
def parseargs(p):
"""
Add arguments and `func` to `p`.
:param p: ArgumentParser
:return: ArgumentParser
"""
p.set_defaults(func=func, firstweekday=6)
p.description = "Displays a calenda... | StarcoderdataPython |
3332628 | from flask import g
def login_log():
print('username: ', g.username)
def login_id_log(id):
pass | StarcoderdataPython |
1766828 | import asyncio
import time
import aiohttp
import binascii
import hashlib
from bosch_thermostat_http.helper import crawl
import bosch_thermostat_http as bosch
from bosch_thermostat_http.const import (FIRMWARE_VERSION, HARDWARE_VERSION,
UUID, SENSORS, DHW, HC, GATEWAY,
... | StarcoderdataPython |
8152412 | # Spiderling: A Spider spawned by the BroodMother.
# DO NOT MODIFY THIS FILE
# Never try to directly create an instance of this class, or modify its member variables.
# Instead, you should only be reading its variables and calling its functions.
from games.spiders.spider import Spider
# <<-- Creer-Merge: imports -->... | StarcoderdataPython |
1952750 | """
This module contains functions to group an arbitrary set of positions
into a number of strategies, each one of the following "basic" strategies
class AssetStrategy(BasicStrategy): A strategy that involves going long or short in an asset
class OffsetStrategy(BasicStrategy): A strategy that involv... | StarcoderdataPython |
1686423 | import pickle
import tensorflow as tf
import numpy as np
from baselines.ddpg.memory import Memory
from baselines.ddpg.ddpg import normalize, denormalize
from baselines.ddpg.models import Discriminator
class Expert:
def __init__(self, limit, env):
self.limit = limit
self.env = env
self.memo... | StarcoderdataPython |
1977403 | <gh_stars>0
import pathlib
PACKAGE_ROOT = pathlib.Path(__file__).resolve().parents[1]
TRAINED_MODEL_DIR = PACKAGE_ROOT / 'trained_models'
DATASET_DIR = PACKAGE_ROOT / 'datasets'
# data
TESTING_DATA_FILE = 'test.csv'
TRAINING_DATA_FILE = 'train.csv'
TARGET = 'SalePrice'
# variables
FEATURES = ['MSSubClass', 'MSZonin... | StarcoderdataPython |
4860614 | <filename>src/utils/paths.py
#!/usr/bin/env python3
from dataclasses import dataclass
from pathlib import Path
@dataclass
class Tools:
root: Path
cmake_file: Path
cmake_file_no_patch: Path
compile: Path
test: Path
gen_polls: Path
scores: Path
def validate(self):
return self.r... | StarcoderdataPython |
8189739 | # <NAME>
medal = 1142338
if sm.canHold(medal):
sm.chatScript("You have earned a new medal.")
sm.startQuest(parentID)
sm.completeQuest(parentID) | StarcoderdataPython |
3447903 | <reponame>Kovszasz/MYG
# Generated by Django 2.2.6 on 2019-10-26 08:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0025_auto_20191026_0805'),
]
operations = [
migrations.AlterField(
model_name='memecontent',
... | StarcoderdataPython |
4909715 | <filename>arrange.py
#arrange.py
#Arranges the fiels according to their types for later classification
#uses shutil, os
import os
import shutil
FOLDER_TYPES = {'pPDF':['pdf'],
'Pimages':['png','jpeg','jpg','gif', 'tiff', 'psd', 'ico'],
'Pvideos':['mp4','mkv','avi','3gp'],
... | StarcoderdataPython |
54546 | """
78 Two bags of Potatoes - https://codeforces.com/problemset/problem/239/A
"""
y,k,n = map(int,input().split())
f=[]
x=k-y%k
while(x<n-y+1):
f.append(str(x))
x+=k
if len(f):
print(' '.join(f))
else:
print('-1') | StarcoderdataPython |
12805004 | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.html import *
from gluon.storage import Storage
def config(settings):
"""
Template for UN O... | StarcoderdataPython |
4965064 | <reponame>Morgenz/bbq<filename>src/retention/policy/retention_policy.py
import logging
from src.retention.policy.filter.grace_period_after_deletion_filter import \
GracePeriodAfterDeletionFilter
from src.retention.policy.filter.most_recent_daily_backup_filter import \
MostRecentDailyBackupFilter
from src.reten... | StarcoderdataPython |
8147392 | def get(*args):
print("In cool_api with args {}".format(args))
return args
| StarcoderdataPython |
1822649 | <gh_stars>0
# importing required libraries
import http.client
import requests
import flask
from flask import jsonify, request
from requests.exceptions import HTTPError
import json
import vendor
# API config
API_KEY = '<KEY>'
API_SECRET = '08011240158e81fe65f363b1c5ec1fe782ff86a17d5b9618591830edead399568b6f27fa64007243... | StarcoderdataPython |
9628627 | # B2082-数字统计
n = list(map(int, input().split()))
s = 0
for i in range(n[0], n[1] + 1):
i = str(i)
s += i.count('2')
print(s) | StarcoderdataPython |
11364975 | <reponame>chatopera/compose4py<filename>setup.py
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from compose4py import __version__
with open("README.md", "r") as fh:
long_description = "".join(fh.readlines())
setup(
name='compose4py',
version=__version__,
description='Onion Model ... | StarcoderdataPython |
296789 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import boto3
import botocore
from botocore.exceptions import WaiterError
from botocore.waiter import WaiterModel, create_waiter_with_client
import logging
import os
import secrets
import time
import json
from cryptogr... | StarcoderdataPython |
301191 | <reponame>IBM/UKI-Technology-Garage
import math
from collections import defaultdict
from prettytable import PrettyTable
MAX_LINE_LENGTH = 90
def split_sentence_to_lines(sentence, max_len):
if len(sentence) <= max_len:
return ['- ' + sentence]
lines = []
line = None
tokens = sentence.split('... | StarcoderdataPython |
1743696 | """
Bokeh based functions for line, histogram and bar charts
"""
import os
import time
import numpy as np
from bokeh import __version__ as bokeh_release_ver
from bokeh.plotting import figure
from bokeh.models import (
HoverTool,
NumeralTickFormatter
)
LOADER = """
#loader {
position: absolute;
... | StarcoderdataPython |
3219177 | i = 1
while i < 100:
i += 1
if i%3 ==0 and i%5==0:
print ("FizzBuzz")
elif i%3 == 0:
print ("Fizz")
elif i%5 == 0:
print ("Buzz")
else:
print(i) | StarcoderdataPython |
3476107 | # Copyright (c) 2021, Usama and Contributors
# See license.txt
# import frappe
import unittest
class TestSaleInvoice(unittest.TestCase):
pass
| StarcoderdataPython |
6558169 | import os
import sys
import urllib2
from bs4 import BeautifulSoup, Comment
import collections
import math
import csv
import re
import numpy as np
import json
import urlparse
import argparse
import traceback
import datetime
import time
import codecs
from operator import itemgetter
from selenium import ... | StarcoderdataPython |
3397201 | <reponame>lanl/NEXMD
#/usr/bin/python
'''
This function collects timings from all trajectories.
If this function is requested, the timings located at the end of the
standard output files (i.e. md.out) are outputted to a file called
'timing.out'. The first column is directory of the trajectory,
followed by its total... | StarcoderdataPython |
5108981 | #!/usr/bin/env python
# encoding: utf-8
"""
Create an AmbiverseNLU repository for the most recent Wikipedia dump versions for the specified languages
-----
# Requires:
* Java 8
* Maven 3
* Python 3
* Postgres 9 running
* (optionally Cassandra 3 running for building)
-----
# How to run it: Check out yago3 next to a... | StarcoderdataPython |
3747 | <gh_stars>0
import numpy as np
# from sklearn.ensemble import BaggingClassifier
# from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.utils.validation import (
check_X_y,
check_array,
NotFittedError,
)
from sklearn.utils.multiclass import check_... | StarcoderdataPython |
3222254 | <gh_stars>1000+
import numpy as np
from .base import ScalarField
from ..geometry.coord_systems import (
cartesian_to_spherical,
cartesian_to_cylindrical)
from ..ransac import (
single_fit,
RANSAC_MODELS,
RANSAC_SAMPLERS)
class XYZScalarField(ScalarField):
def extract_info(self):
self.... | StarcoderdataPython |
3546942 | # Generated by Django 2.0.8 on 2020-04-02 11:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('angles', '0010_residueangle_tau_angle'),
]
operations = [
migrations.AddField(
model_name='residueangle',
name='chi1... | StarcoderdataPython |
6649395 | # (C) Copyright 2016-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
#
# Unless required by ... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.