id stringlengths 2 8 | text stringlengths 16 264k | dataset_id stringclasses 1
value |
|---|---|---|
3397843 | <filename>src/roadimage.py
from road import Road
from mark_tracker import MarkTracker
from roadgraphics import *
from crosswalk import CrossWalk
import random
import math
import drawings as drw
class RoadImage:
def __init__(self, dimensions, path, background_images, asphalt_textures, templates_collection, seed=0, ... | StarcoderdataPython |
6619224 | from omero.gateway import (
BlitzObjectWrapper,
_DatasetWrapper,
_ImageWrapper,
)
from qtpy.QtCore import QModelIndex
from qtpy.QtGui import QStandardItem, QStandardItemModel
from .gateway import QGateWay
from typing import Dict
class OMEROTreeItem(QStandardItem):
def __init__(self, wrapper: BlitzObje... | StarcoderdataPython |
1636941 | from datetime import datetime
from django.db.models import Count
import olympia.core.logger
from olympia.amo.celery import task
from olympia.amo.decorators import use_primary_db
from .models import Collection, CollectionAddon
log = olympia.core.logger.getLogger('z.task')
@task
@use_primary_db
def collection_met... | StarcoderdataPython |
3388643 | <filename>zinki_smachine/src/zinki_smachine/__init__.py<gh_stars>0
from state import *
from state_machine import *
from state_name import *
from transition_name import * | StarcoderdataPython |
1922768 | '''
Server-Class for the extractions of IoC's.
'''
# pylint: disable=C0413, C0411
import os
import sys
import json
import pytz
import re
import iocextract as ioce
sys.path.append('..')
from io import StringIO
from threading import Thread
from kafka.producer import KafkaProducer
from kafka.consumer import KafkaCons... | StarcoderdataPython |
8102763 | import sys
def get_python_version():
major=sys.version_info.major
minor=sys.version_info.minor
micro=sys.version_info.micro
releaselevel=sys.version_info.releaselevel
serial=sys.version_info.serial
version=f"{major}.{minor}.{micro}"
if releaselevel!="final":
version+=f"-{r... | StarcoderdataPython |
1643902 | from django.apps import AppConfig
class ShareimgConfig(AppConfig):
name = 'shareimg'
| StarcoderdataPython |
3218065 | <reponame>daVinciCEB/Basic-Python-Package
import unittest
from context import core
class ExampleTest(unittest.TestCase):
"""An example test in unittest fashion."""
def setUp(self):
pass
def test_will_pass(self):
self.assertEqual(1, 1)
def test_will_not_pass(self):
self.assertE... | StarcoderdataPython |
3570868 | # Training
from keras.preprocessing.image import ImageDataGenerator
from keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau, TensorBoard, CSVLogger
from keras.optimizers import SGD
from keras import backend as K
from models.model3 import M_b_Xception_896
trainset_dir = 'data/train/'
va... | StarcoderdataPython |
6428700 | <filename>tests/conftest.py
import asyncio
import pytest
@pytest.fixture(scope='session')
def simple_gen():
return _simple_gen
async def _simple_gen(sequence, delay=0):
for item in sequence:
yield await asyncio.sleep(delay, item)
| StarcoderdataPython |
3496106 | <filename>glycan_profiling/output/xml.py
import os
import re
import bisect
from collections import defaultdict, OrderedDict, namedtuple, deque
from brainpy import mass_charge_ratio
import glypy
from glypy.composition import formula
from glypy.io.nomenclature import identity
from glypy.structure.glycan_composition im... | StarcoderdataPython |
3480722 | <gh_stars>1-10
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from articles.models import Article, Tag
class ArticleListView(ListView):
model = Article
ordering = ['-first_commit']
paginate_by = 10
def get_context_data(self, **kwargs):
co... | StarcoderdataPython |
1918914 | <reponame>1323ED5/tic-tac-toe-AI
from src.dimension import Dimension
from src.game_mechanic import GameMechanic
from src.turn import generate_turns
from src.utils import clear_console
class AIMixin:
def bot_turn(self):
turns = generate_turns(self.area)
root_dimension = Dimension(self.area, self.a... | StarcoderdataPython |
353960 | <reponame>hechth/vimms<filename>vimms/scripts/box_controller.py
import itertools
import random
from time import perf_counter
from vimms.Box import GenericBox, DictGrid, ArrayGrid, LocatorGrid, AllOverlapGrid, IdentityDrift
from vimms.GridEstimator import GridEstimator
from vimms.ChemicalSamplers import DatabaseFormula... | StarcoderdataPython |
4970731 | from app.api.models.LXDModule import LXDModule
from pylxd import Client
import logging
logging = logging.getLogger(__name__)
class LXCProfile(LXDModule):
def __init__(self, input):
logging.info('Connecting to LXD')
super().__init__()
self.input = input
def info(self):
try:
... | StarcoderdataPython |
12841803 | <filename>proxy_server/helpers.py
import base64
def generate_service_url(function_path, params=None, encrypted=False):
if not params:
return function_path
else:
path_end = str()
for key, value in params.iteritems():
if encrypted:
value = base64.urlsafe_b64enc... | StarcoderdataPython |
209005 | import time, math, board, busio, adafruit_mprls, adafruit_mma8451, serial, picamera
cam = picamera.PiCamera()
#path = "/sys/bus/w1/devices"
#tempData = open(path+"w1_slave", "r")
i2c = busio.I2C(board.SCL, board.SDA)
mpr = adafruit_mprls.MPRLS(i2c, psi_min=0, psi_max=25)
mma = adafruit_mma8451.MMA8451(i2c, address=0... | StarcoderdataPython |
6446362 | """
Handles the connections to the database
get_trending_scores puts the trending_scores from the
database in a dictionary
get_train_matrix fetches data from the database and puts
it into a training matrix for the lightFM model
get_test_matrix fetches data from the database and puts
it into a test matrix from the lig... | StarcoderdataPython |
4826894 | # coding:utf-8
from django import template
register = template.Library()
@register.filter
def appc(value):
return str(value) + "1222"
| StarcoderdataPython |
6533242 | <gh_stars>1-10
# -*- mode: python; -*-
"""
Support code related to OS detection in general. System specific facilities or customization
hooks live in mongo_platform_<PLATFORM>.py files.
"""
import os
# --- OS identification ---
#
# This needs to precede the options section so that we can only offer some options on c... | StarcoderdataPython |
6636881 | from tkinter import (
Tk,
Label,
Button,
PhotoImage,
LEFT
)
from tkinter.ttk import Separator
class MainWindow:
def __init__(self, dolar: str, euro: str, bitcoin: str) -> None:
"""Construtor da classe MainWindow."""
self.__lista_cotacoes: list = list([dolar, euro, bitcoin])
... | StarcoderdataPython |
3405142 | <reponame>Bhuvan-21/SyferText
import torch
from torchvision import transforms
class ToTensor:
def __init__(self):
self.transform = transforms.ToTensor()
def __call__(self, x):
return self.transform(x)
class Resize:
def __init__(self, size):
self.transform = transforms.Resize(siz... | StarcoderdataPython |
3576856 | <reponame>Omarzintan/bumblebee-ai
from features.default import BaseFeature
import wolframalpha
from features import wiki_search
class Feature(BaseFeature):
def __init__(self, bumblebee_api):
self.tag_name = "wolfram_search"
self.patterns = [
"calculate",
"evaluate",
... | StarcoderdataPython |
1655051 | <filename>StimControl/Experiments/Quest.py
#!/usr/bin/env python
# Copyright (c) 1996-2002 <NAME>
# Copyright (c) 1996-9 <NAME>
# Copyright (c) 2004-7 <NAME>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... | StarcoderdataPython |
11312234 | """toolsql makes it easy to read and write from sql databases"""
from .cli import *
from .crud_utils import *
from .migrate_utils import *
from .sqlalchemy_utils import *
from .dba_utils import *
from .exceptions import *
from .schema_utils import *
from .spec import *
from .summary_utils import *
__version__ = '0.... | StarcoderdataPython |
4994597 | <filename>src/pages.py
import streamlit as st
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.metrics import roc_auc_score, accuracy_score, confusion_matrix, classification_report,plot_confusion_matrix
from sklearn.model_selection import cross_val_score
plt.style.use('fivethirtyei... | StarcoderdataPython |
11300837 | <gh_stars>10-100
# BSD 3-Clause License
#
# Copyright (c) 2017, Science and Technology Facilities Council and
# The University of Nottingham
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * R... | StarcoderdataPython |
4826220 | <reponame>MeWu-IDM/scirisweb
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 22 16:57:44 2019
@author: cliffk
"""
from distributed import Scheduler
from tornado.ioloop import IOLoop
from threading import Thread
loop = IOLoop.current()
t = Thread(target=loop.start, daemon=True)
t.start()
s = Sc... | StarcoderdataPython |
3297126 | import numpy as np
print ("hello world")
def circumference(r):
return np.pi*2*r
def surface_area (r):
return np.pi*r**2
| StarcoderdataPython |
9607354 | <filename>ranking.py
import csv
READ_PATH = 'yt_wonderland/data/world-happiness-report/2017.csv'
WRITE_PATH = 'new_data.csv'
DIMENSIONS_TO_RANK = [
{
"name": "Economy_GDP_Per_Capita",
"higher_is_better": True
},
{
"name": "Generosity",
"higher_is_better": True
},
{
... | StarcoderdataPython |
4877121 | <reponame>grice/RNAtools
import RNAtools.partAlign as m2
import os
import math
from pathlib import Path
import pytest
filepath = os.path.dirname(__file__)
data_dir = Path(f'{filepath}/../data')
@pytest.mark.skip(reason="Currently fails, not sure why though.")
def test_partAlign():
"""
Tests partition aligner... | StarcoderdataPython |
8136074 | <gh_stars>10-100
import json
from django.db import models
from openhumans.models import OpenHumansMember
CERTAINTY_CHOICES = [
(1, "Random guess"),
(2, "Very uncertain"),
(3, "Unsure"),
(4, "Somewhat certain"),
(5, "Very certain"),
]
class RetrospectiveEvent(models.Model):
member = models.F... | StarcoderdataPython |
3293765 | """
Serializer for a request user's information
"""
# stdlib
from typing import Dict
# lib
from rest_framework import serializers
# local
from api.models import Settings
__all__ = [
'SettingsSerializer',
]
NOTIFICATION_VALUES = {True, False}
THEMES = {
'beta',
'blue',
'green',
'purple',
'red'... | StarcoderdataPython |
1834427 | import random
from datetime import datetime
start_time = datetime.now()
def merge_sort(arr):
if len(arr) <= 1:
return arr
middle = len(arr) // 2
left = merge_sort(arr[:middle])
right = merge_sort(arr[middle:])
return merge(left, right)
def merge(left, right):
result = []
while len(... | StarcoderdataPython |
8003463 | <filename>plugin.git.browser/github/downloader.py
# -*- coding: utf-8 -*-
'''*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versi... | StarcoderdataPython |
162680 | <filename>insert_DataBase_robot.py
import pyautogui
import time
import pyperclip
# Fazer o código para cada tipo de bd;
pyautogui.PAUSE = 2.0
pyautogui.press('win')
pyautogui.write('pgadmin4')
pyautogui.press('enter')
| StarcoderdataPython |
1854484 | <reponame>elipavlov/transport-nov-parser
# coding=utf-8
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
import six
import math
from django.db import models
class EnumBase(six.with_metaclass(ABCMeta, object)):
@property
@abstractmethod
def as_tuple(self):
raise ... | StarcoderdataPython |
6499357 | from django.db import models
from django.contrib.auth.models import AbstractUser, BaseUserManager
class MyAccountManager(BaseUserManager):
def create_user(self, first_name, last_name, username, email, password=None):
if not email:
raise ValueError('User must have an email address')
if... | StarcoderdataPython |
173413 | <reponame>Fritzenator/hashcode-2020
import numpy as np
import numba
@numba.jit(nopython=True)
def knapsack(values, weights, max_weight):
"""
Returns tuple (total summed value, chosen items)
"""
t = np.zeros((len(values), max_weight + 1), dtype=np.float64)
# Fill-in the value table using the recur... | StarcoderdataPython |
6435029 | <reponame>caiges/populous<gh_stars>1-10
import unittest
import os
import time
from PIL import Image
from django.conf import settings
from populous.thumbnail.base import Thumbnail
from populous.thumbnail.main import DjangoThumbnail, get_thumbnail_setting
from populous.thumbnail.processors import dynamic_import, get_va... | StarcoderdataPython |
9706338 | <reponame>KazakovDenis/django-extensions
# -*- coding: utf-8 -*-
from django.contrib.auth.mixins import UserPassesTestMixin
class ModelUserFieldPermissionMixin(UserPassesTestMixin):
model_permission_user_field = 'user'
def get_model_permission_user_field(self):
return self.model_permission_user_field... | StarcoderdataPython |
279446 | """
The PSD Submodule
=================
The PSD submodule provides implementations of various particle size
distributions for the use in scattering calculations.
In addition to that, :code:`artssat.scattering.psd.arts` subpackage defines
the interface for PSDs in ARTS, while the :code:`artssat.scattering.psd.data`
su... | StarcoderdataPython |
5142008 | import setuptools
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
name="madlib_generator",
version="0.1.1",
author="Adrian-at-CrimsonAuzre",
author_email="<EMAIL>",
description="A small example package",
long_descrip... | StarcoderdataPython |
5073707 | from keras.layers import Embedding
# The Embedding layer takes at least two arguments:
# the number of possible tokens, here 1000 (1 + maximum word index),
# and the dimensionality of the embeddings, here 64.
embedding_layer = Embedding(1000, 64)
from keras.datasets import imdb
from keras import preprocessing
# Numb... | StarcoderdataPython |
3373759 | # Copyright 2018 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | StarcoderdataPython |
396212 | <gh_stars>1-10
from django.shortcuts import render, get_object_or_404 as G404
from .models import (
PageSkin as S,
PageNames as P,
AboutPageNames,
RotatorEditorPageNames,
)
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from rekruter.models impo... | StarcoderdataPython |
3543699 | """ this script extracts a list of custom dimensions in a Google Analytics property
using the Management API and exports to CSV
"""
import argparse
import config
import csv
from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
from oauth2client impo... | StarcoderdataPython |
8029692 | <reponame>object-oriented-human/competitive
print(list(input()).index('F')+1) | StarcoderdataPython |
6620535 | <filename>app/settings.py
import os
# Amount of seconds before a player can win, this functions as a buffer, so that nobody wins by "accident"
# Used by register_card() in office_game.py
GAME_START_TIME_BUFFER = int(os.environ.get('OG_GAME_START_TIME_BUFFER', 10))
# Amount of seconds before a new card registration tim... | StarcoderdataPython |
6660586 | """Supervisr PowerDNS DB Router"""
class PowerDNSRouter:
"""
A router to control all database operations on models in the
PowerDNS application.
"""
# pylint: disable=unused-argument
def db_for_read(self, model, **hints):
"""Attempts to read auth models go to PowerDNS."""
if mo... | StarcoderdataPython |
11364402 | <reponame>internap/redlock-fifo
# Copyright 2016 Internap
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | StarcoderdataPython |
6671463 |
import configparser
from mirage.tables.helpUtils import UUID, isHexadecimal, isPrintable
class Attribute:
def __init__(self, ATThandle=None, ATTtype=None, ATTvalue=None):
self.ATThandle = ATThandle
self.ATTvalue = ATTvalue
self.ATTtype = ATTtype
def __str__(self):
return '''... | StarcoderdataPython |
11316965 | <reponame>AndreAloise77/TccJogosTestes
import os
from datetime import datetime
from typing import Dict, List
# Import Tree
from xml.etree.ElementTree import ElementTree
# Import Services
import Services.AGatsService
import Services.ExtractProvDataService
import Services.GatsService
# Import Utils
import Utils.Utilitie... | StarcoderdataPython |
4942374 | <reponame>Lumonk/CNNs.PyTorch<gh_stars>1-10
from .transform import RandomLighting
from .lrscheduler import LRScheduler, LRSequential
from .sgd import SGD
from .label_smoothing import CrossEntropyLoss_LS | StarcoderdataPython |
6661171 | from more_itertools import ilen
from my.spotify import playlists, songs, Playlist, Song
def test_spotify():
items = list(playlists())
assert len(items) > 0
plist = items[0]
assert isinstance(plist, Playlist)
songs = plist.songs
assert len(songs) > 0
assert isinstance(songs[0], Song)
def... | StarcoderdataPython |
4971322 | from pylons import tmpl_context as c
from pylons import app_globals as g
from pylons.i18n import _
from r2.config import feature
from r2.controllers import add_controller
from r2.controllers.reddit_base import RedditController
from r2.lib.errors import errors
from r2.lib.require import require, RequirementException
fr... | StarcoderdataPython |
4892153 | <gh_stars>10-100
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
from requre.online_replacing import record_requests_for_all_methods
from tests.integration.pagure.base import PagureTests
from ogr.exceptions import OperationNotSupported, PagureAPIException
@record_requests_for_all_meth... | StarcoderdataPython |
9725970 | #----------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#------------------------------------------------------------------... | StarcoderdataPython |
167559 | from django.urls import reverse
from django.test import TestCase
from stacks.models import Stack
from people.models import Person
from rest_framework.test import APIClient
from dashboards.models import Dashboard
from domain_mappings.models import DomainMapping, MappingType
from owf_groups.models import OwfGroupP... | StarcoderdataPython |
1685523 | import pygame as pg
from pygame.math import Vector2
from time import time
from math import sin, cos, pi, sqrt
from random import random
from enum import Enum, auto
from app import config
from app.utils.functions import distance, sign, collide_rect
from app.game.sprite import VectoredSprite
# Directions
RIGHT = 1
LE... | StarcoderdataPython |
1796471 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - cologler <<EMAIL>>
# ----------
#
# ----------
'''
NimbleText template:
@property
def <% $0.toWords().replace(/ /gm, '_').toLowerCase() %>(self):
return self._get('$0')
'''
class _BaseModel:
def __init__(self, data: dict):
... | StarcoderdataPython |
3515736 | """This file is part of the trivago/rebase library.
# Copyright (c) 2018 trivago N.V.
# License: Apache 2.0
# Source: https://github.com/trivago/rebase
# Version: 1.2.2
# Python Version: 3.6
# Author: <NAME> <<EMAIL>>
"""
import uuid
from typing import Any, Dict, List
import logging
import simplejson as json
class ... | StarcoderdataPython |
3535032 | """Sample module"""
import logging
def sample_func(say=True):
"""Sample func"""
logging.debug("Enter sample_func()")
if say:
logging.info("Sample func")
return True
if __name__ == "__main__":
sample_func() | StarcoderdataPython |
1859073 | <gh_stars>100-1000
"""Tasks are how scheduler identifies and executes your application."""
| StarcoderdataPython |
4959436 | <reponame>ysd1123/BiliSpider
'''
内置 data() 函数,以字典形式返回参数 uuid 所对应的Bilibili 用户的数据。
video_view:视频浏览
article_view:文章浏览
like:总点赞
'''
import requests
def data(uuid):
def be_simple(orig_dict):
simple_dict = {'video_view': orig_dict['archive']['view'],
'article_view': orig_dic... | StarcoderdataPython |
11350240 | <reponame>l33tdaima/l33tdaima<gh_stars>1-10
class Solution:
def checkValidStringV1(self, s: str) -> bool: # backtrack
WILDCARD = ["(", "", ")"]
def backtrack(wip, t):
for i in range(len(t)):
if t[i] == "*": # wildcard
for w in WILDCARD:
... | StarcoderdataPython |
139059 | import imp
import sys, pygame
from pygame.locals import * # Needed for Key Constants
pygame.init() # Initializes Pygame
# Declarations
size = width, height = 640, 480 # Defines Windows Size
speed = [0, 0] # X and Y Speeds
black = 0, 0, 0 # Represents black colour as RGB
# Sets Windows Size
screen = pygame.display.set... | StarcoderdataPython |
8133953 | <gh_stars>0
#!/usr/bin/env python
# $Id$
""" solutions"""
import puzzler
from puzzler.puzzles.pentahexes import PentahexesTriangle1
puzzler.run(PentahexesTriangle1)
| StarcoderdataPython |
242651 | <reponame>hyzyla/directory.org.ua
"""Init tables
Revision ID: 8512fa6a4a52
Revises:
Create Date: 2022-01-22 17:42:33.225268
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "<KEY>"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
... | StarcoderdataPython |
12824545 | # encoding : UTF-8
from Engine.Display import debug3D_utils
from Engine.Collisions import AABBCollider
from Settings import *
import pygame as pg
from math import sqrt
from Engine.Actions import ActionObject
from Game.character_states import *
class Character(ActionObject):
def __init__(self, position=None, player... | StarcoderdataPython |
9760166 | from typing import Any
from boa3.builtin import public
from boa3.builtin.nativecontract.stdlib import StdLib
@public
def deserialize_arg(arg: bytes) -> Any:
return StdLib.deserialize(arg)
| StarcoderdataPython |
6570635 | from distutils.core import setup
setup(name='point-to-define',
version='1.0',
packages=['point_to_define'],
) | StarcoderdataPython |
1844142 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-11-13 15:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('website', '0007_auto_20161113_1346'),
]
operations = [
migrations.AlterU... | StarcoderdataPython |
4875313 | # ===============================================================================
# Copyright 2011 <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/... | StarcoderdataPython |
9777722 | <filename>Exercicio_em_python/Dados_pessoais.py
n = int(input("Quantas pessoas serão digitadas? "))
altura = [0 for x in range(n)]
genero = [0 for x in range(n)]
for i in range(n):
altura[i] = float(input(f"Altura da {i+1}a pessoa: "))
genero[i] = str(input(f"Genero da {i+1}a pessoa: "))
menor = altura[0]
m... | StarcoderdataPython |
8193258 | import gym
import yaml
from tqdm import tqdm
import numpy as np
import torch
from torch.utils.data import DataLoader
from src.atari_archive.utils.data import EnvDataset, Summary
from src.atari_archive.utils.networks import ConvEncoder
from src.atari_archive.utils.preprocess import preprocess_state
from src.atari_archiv... | StarcoderdataPython |
5148663 | # -*- coding: utf-8 -*-
"""
Model Map table air_lekeage_building_distribution
:author: <NAME>
:version: 0.1
:date: 15 Dec. 2017
"""
__docformat__ = "restructuredtext"
class AirLekeageBuildingDistribution():
""" DB Entity air_lekeage_building_distribution to Python object AirLekeageBuildingDistrib... | StarcoderdataPython |
3306067 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('fleet', '0013_auto_20170814_1138'),
]
operations = [
migrations.AlterField(
model_name='historicalvehicle',
... | StarcoderdataPython |
12827571 | <reponame>RumbleDB/rumbleml-experiments
# sklearn core
from pyspark.ml import Pipeline
# Preprocessing
from pyspark.ml.feature import StandardScaler, MaxAbsScaler, PCA, VectorAssembler, Imputer, OneHotEncoder
# Models
from pyspark.ml.regression import LinearRegression
from pyspark.ml.classification import LogisticReg... | StarcoderdataPython |
8125505 | lanches = 'hambúrguer', 'suco', 'refri', 'sorvete'
# COM FOR PODEMOS IMPRIMIR TODOS ELEMENTOS SEPARADAMENTE, JÁ QUE ELE ACEITA O range() OU UMA VARÍAVEL
for comida in lanches:
print(f'Eu comi {comida}.')
# COMO PODEMOS FATIAR AS TUPLAS, HÁ OUTRA MANEIRA DE MOSTRAR OS ELEMENTOS
for c in range(len(lanches)):# O LEN... | StarcoderdataPython |
3575575 | import numpy
from scipy.ndimage import zoom
from dexp.utils import xpArray
from dexp.utils.backends import Backend, NumpyBackend
def warp(
image: xpArray,
vector_field: xpArray,
vector_field_upsampling: int = 2,
vector_field_upsampling_order: int = 1,
mode: str = "border",
image_to_backend: b... | StarcoderdataPython |
5048568 | <reponame>aeko-empt/ovs-dbg
import ovs_dbg.ofparse.ofp # noqa: F401
import ovs_dbg.ofparse.dp # noqa: F401
| StarcoderdataPython |
6614319 | #!/usr/bin/env python3
import requests, datetime
from time import sleep
urls = ['http://cpt.hopper.pw:LBbRhmu3gV@ipv4.www.hopper.pw/nic/update']
# basic auth to hopper.pw updates
while True:
for url in urls:
try:
r = requests.get(url, auth=('cpt.hopper.pw', 'LBbRhmu3gV'))
print("response @", datetime.dateti... | StarcoderdataPython |
12845876 | """
Train and eval functions used in main.py
"""
import os
import torch
from torch.utils.data import DataLoader, DistributedSampler
import math
import sys
import time
import datetime
from typing import Iterable
from pathlib import Path
import json
import random
import numpy as np
import torch
import wandb
from datase... | StarcoderdataPython |
6701938 | <reponame>SHI3DO/Tennessine
def prod(amount):
A = [["IronIngot"], "Constructor", [amount], [amount/15], 1]
return A
| StarcoderdataPython |
4912152 | <reponame>dutxubo/nni
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import tensorflow as tf
_counter = 0
def global_mutable_counting():
global _counter
_counter += 1
return _counter
class AverageMeter:
def __init__(self, name):
self.name = name
self.val = ... | StarcoderdataPython |
276330 | <reponame>pomes/valiant<filename>tests/repositories/pypi/__init__.py
"""PyPi Repo tests.
Copyright (c) 2020 The Valiant Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction... | StarcoderdataPython |
393806 | # -*- coding: utf-8 -*-
from setuptools import setup
import os
readmefile = os.path.join(os.path.dirname(__file__), "README.md")
with open(readmefile) as f:
readme = f.read()
setup(
name='jumanpp-batch',
version='0.1.2',
description='Apply juman++ to batch inputs in parallel',
author='<NAME>',
... | StarcoderdataPython |
1825824 | <filename>colcon_acceleration/subverb/platform.py<gh_stars>1-10
# ____ ____
# / /\/ /
# /___/ \ / Copyright (c) 2021, Xilinx®.
# \ \ \/ Author: <NAME> <<EMAIL>>
# \ \
# / /
# /___/ /\
# \ \ / \
# \___\/\___\
#
# Licensed under the Apache License, Version 2.0
#
import os
from c... | StarcoderdataPython |
4868717 | <reponame>rmm-ch/ho-distribute
#!/usr/bin/env python3
'''
plot data from a triplet of log files - assumes already converted to CSV
example usage:
$ ipython
> %run csv_to_graph.py --logdir <path to where your csv files were saved>
'''
import argparse
import os.path, fnmatch
import pandas as pd
import matplot... | StarcoderdataPython |
8129192 | from AST import(And,Or,Arrow,Not,Var,true,false, Pred, Forall, Exists)
from Exceptions import(LexException, ParseException)
from enum import Enum
def parse(text):
return expr(lex(text))
####################################################################
# Lexer
# converts a string of characters into a list of to... | StarcoderdataPython |
4882580 |
github_user = "example"
github_pass = "<PASSWORD>"
gmail_user = "<EMAIL>"
gmail_pass = "<PASSWORD>"
email_text = """\
From: {}
To: {}
Subject: Github Project \'{}\'
Hi {}!
I noticed you gave my project \'{}\' ({}) a star on Github.
First of all: thank you for that! :)
I would like to improve the project by taking... | StarcoderdataPython |
6650114 | <gh_stars>0
from __future__ import print_function, absolute_import, division
import os
import shutil
from os.path import join, dirname
import sys
import time
from pprint import pprint
import numpy as np
from progress.bar import Bar as Bar
from sklearn import metrics
import json
import torch
import torch.nn as nn
impo... | StarcoderdataPython |
8156368 | from logics.classes.exceptions import NotWellFormed
def separate_arguments(string, comma_separator):
"""
Given a string in forrmat '(x,y,z...)' returns a list with format ['x', 'y', 'z', ...]
Takes into account nested parentheses. For instance, '(1,(2,3),4)' will return ['1', '(2,3)', '4']
WILL NOT EL... | StarcoderdataPython |
3202070 | import functools
import inspect
import mwbot.cli as cli
import mwbot.cred as cred
import mwbot.util as util
from mwbot.bot import Task
__all__ = []
export = util.append_name_wrapper(__all__)
export(Task)
def require_task(func):
@functools.wraps(func)
def wrapper(cls, *args, **kwargs):
if type(cls) !... | StarcoderdataPython |
11326555 | <gh_stars>0
"""
Модульные тесты для проверки задания №6 с сайта:
https://pythonworld.ru/osnovy/tasks.html
"""
import unittest
from prime import is_prime
class TestIsPrime(unittest.TestCase):
"""
Набор тестов для проверки поведения функции is_prime().
"""
def test_prime(self):
"""
Тест... | StarcoderdataPython |
1743014 | import logging
import os
import azure.functions as func
from azure.storage.blob import BlobClient, BlobProperties, BlobType, ContentSettings
def main(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob Size: {m... | StarcoderdataPython |
233318 | <filename>tests/core/helpers/test_helpers_iam.py
# -*- coding: utf-8 -*-
import pytest
from cottonformation.core import helpers
from cottonformation.tests.helpers import jprint
class TestAssumeRolePolicyBuilder:
def test_build(self):
assert helpers.iam.AssumeRolePolicyBuilder(
helpers.iam.Ser... | StarcoderdataPython |
8053788 | <reponame>ymarkovitch/ipp-crypto
#===============================================================================
# Copyright 2017-2019 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, informati... | StarcoderdataPython |
3366710 | <gh_stars>1-10
import Utils
from Utils import logCall
import wx
import six
import wx.lib.intctrl
import Model
from HighPrecisionTimeEdit import HighPrecisionTimeEdit
from Undo import undo
import sys
import random
import datetime
#--------------------------------------------------------------------------------------... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.