id
stringlengths
1
7
text
stringlengths
6
1.03M
dataset_id
stringclasses
1 value
3268076
# -*- coding: utf-8 -*- """Test that closed File and SifData instances behave as expected. """ import os import unittest import freesif as fs FILES = os.path.join(os.path.dirname(__file__), 'files') hydrodata_methods_and_args = [('get_addedmass', ()), ('get_angular_freqs', ()), ...
StarcoderdataPython
3398447
#!/usr/bin/env python # coding: utf-8 # monthlyMetrics.py # # Inputs # investType: Investment type -> fund or ETF # filename: spreadsheet to output data, can be left blank # month: month to collect data points for, can be left blank # year: year to collect data points for, can be left blank # # Ex...
StarcoderdataPython
3311278
<filename>cannabis_api/api/migrations/0002_auto_20190409_2107.py # Generated by Django 2.2 on 2019-04-09 21:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.AlterField( mo...
StarcoderdataPython
139219
<reponame>joel-mb/Scenic """Support for checking Scenic types.""" import sys import inspect import numbers import typing from scenic.core.distributions import (Distribution, RejectionException, StarredDistribution, distributionFunction) from scenic.core.lazy_eval import (Delayed...
StarcoderdataPython
4826630
<gh_stars>100-1000 import cocotb import re class uvm_hdl(): dut = None re_brackets = re.compile(r'(\w+)\[(\d+)\]') @classmethod def set_dut(cls, dut): cls.dut = dut cls.SIM_NAME = cocotb.SIM_NAME @classmethod def split_hdl_path(cls, path): if cls.SIM_NAME == 'Veril...
StarcoderdataPython
1657424
from typing import Iterable, Mapping, TypeVar, Union, Callable T = TypeVar('T') R = TypeVar('R') def iterable_or_varargs( args: Union[Iterable[T], Iterable[Iterable[T]]], dispatch: Callable[[Iterable[T]], R] = lambda x: x ) -> R: assert isinstance(args, Iterable) if len(args) == 1: it...
StarcoderdataPython
157640
<gh_stars>10-100 from __future__ import annotations from jsonclasses import jsonclass, types def check_owner(article: GMArticle, operator: GMAuthor) -> bool: return article.author.id == operator.id def check_tier(article: GMArticle, operator: GMAuthor) -> bool: return operator.paid_user @jsonclass class G...
StarcoderdataPython
1670676
import matplotlib matplotlib.use('Agg') import os import time import itertools import json import requests from flask import Blueprint, request, jsonify, render_template, make_response, send_file from flask_jwt_extended import jwt_required from utils.connect import client, db, fs from itertools import chain from collec...
StarcoderdataPython
1601230
from django.apps import AppConfig class DemoConfig(AppConfig): name = "openpersonen.contrib.demo" verbose_name = "Demo backend"
StarcoderdataPython
112651
<filename>app/services/RelationService.py from typing import Generator from rdflib import BNode, Graph, Literal, URIRef from rdflib.collection import Collection from rdflib.namespace import OWL, RDF from rdflib.plugins.sparql import prepareQuery from rdflib.plugins.sparql.processor import SPARQLResult from models.name...
StarcoderdataPython
1698002
<gh_stars>0 #!/usr/bin/env python # encoding=utf-8 """ created by maxuewei2 """ from PIL import Image, ImageFilter import os import math import time """ 针对分辨率为1920*1080,分辨率不同请自行修改代码 """ man_colors = [[85, 77, 125], [64, 66, 91], [86, 76, 124], [64, 51, 86], [54, 60, 102]] man_colors = [tuple(x) for x in man_colors] ...
StarcoderdataPython
1610790
class Queue: def __init__(self): self.items = [] def enqueue(self, node): self.items.append(node) def sortedEnqueue(self, node): i = 0 while i < len(self.items) and self.items[i].f <= node.f: i = i + 1 self.items.insert(i, node) ...
StarcoderdataPython
4838812
"""Data pipelines based on efficient video reading by nvidia dali package.""" import cv2 from nvidia.dali import pipeline_def import nvidia.dali.fn as fn from nvidia.dali.pipeline import Pipeline from nvidia.dali.plugin.pytorch import DALIGenericIterator import nvidia.dali.types as types import torch from typeguard im...
StarcoderdataPython
45653
<filename>tutorials/basics/g_code_listing_01.py r""" Basic workflow ============== This examples demonstrates a basic workflow using the `py-fmas` library code. .. codeauthor:: <NAME> <<EMAIL>> """ ############################################################################### # We start by simply importing the requ...
StarcoderdataPython
116148
<gh_stars>1-10 from setuptools import setup, find_packages DESCRIPTION = 'Ensures loading of specified app modules.' LONG_DESCRIPTION = None setup(name='django-autoload', version='0.01', packages=find_packages(exclude=('tests', 'tests.*', 'base_project', 'base_project...
StarcoderdataPython
1696129
# # Copyright 2021 Red Hat Inc. # SPDX-License-Identifier: Apache-2.0 # """Serializers for Masu sources API.""" from rest_framework import serializers from api.iam.models import Customer from api.provider.models import Provider from api.provider.models import ProviderInfrastructureMap from api.provider.models import S...
StarcoderdataPython
3387225
import torch import torch.nn as nn from arch_resnet38 import Resnet38 import torch.nn.functional as F from torchvision import transforms import numpy as np import imutils import os import re class BaseModel(nn.Module): def initialize_weights(self): for m in self.modules(): if isinstance(m, nn.C...
StarcoderdataPython
54239
import numpy as np import torch class ModuleMixin(object): """ Adds convenince functions to a torch module """ def number_of_parameters(self, trainable=True): return number_of_parameters(self, trainable) def number_of_parameters(model, trainable=True): """ Returns number of trainable...
StarcoderdataPython
1788966
<reponame>FernanddoSalas/blog-api<gh_stars>1-10 """Post Filters.""" # Filters from django_filters import rest_framework as filter # Models from apps.posts.models import Post class PostFilter(filter.FilterSet): """Filter by post's creator (username).""" username = filter.CharFilter(field_name='user', lookup...
StarcoderdataPython
1660187
from output.models.nist_data.atomic.float_pkg.schema_instance.nistschema_sv_iv_atomic_float_white_space_1_xsd.nistschema_sv_iv_atomic_float_white_space_1 import NistschemaSvIvAtomicFloatWhiteSpace1 __all__ = [ "NistschemaSvIvAtomicFloatWhiteSpace1", ]
StarcoderdataPython
166994
# -*- coding: utf-8 -*- # Copyright 2021 UuuNyaa <<EMAIL>> # This file is part of x7zipfile. import glob import os import shutil import stat import tempfile import unittest from tests import x7zipfile from .archives import ARCHIVES, ARCHIVES_PATH class TestCase(unittest.TestCase): def test_archive_list(self): ...
StarcoderdataPython
1745074
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file from waflib import Utils from waflib.Configure import conf @conf def d_platform_flags(self): v=self.env if not v.DEST_OS: v.DEST_OS=Utils.unversioned_sys_platform() binfmt=Utils.destos_to_binfmt...
StarcoderdataPython
1791001
from unittest import TestCase from day7.part1.get_signal_for_wire import get_signal_for_wire class TestGetSignalForWire(TestCase): def test_get_signal_for_wire_1(self): expected_value = 72 instructions = [ "123 -> x", "456 -> y", "x AND y -> d" ] ...
StarcoderdataPython
4836602
from keras import backend as K from overrides import overrides from ..masked_layer import MaskedLayer class Multiply(MaskedLayer): """ This ``Layer`` performs elementwise multiplication between two tensors, supporting masking. We literally just call ``tensor_1 * tensor_2``; the only reason this is a ``L...
StarcoderdataPython
158360
import sys import threading import logging import os import datetime import time import socket import SerialPortController class TcpSerialPortClient: def __init__(self, server, client_socket, client_address): self.logger = logging.getLogger("TcpSerialPortClient-{}".format(client_address)) self.se...
StarcoderdataPython
111658
<reponame>enisteper1/AWS-Deployed-ML from django.forms import ModelForm, Textarea from .models import Data class DataForm(ModelForm): class Meta: model = Data fields = '__all__' widgets = { 'body': Textarea() }
StarcoderdataPython
4801416
import Polyamorphic import ReadFile import LineMatch import MyFli import DelErrorDate import MyPlot import WriteExcel import FindBestGroup # ----------------------------------------------------------------------------------------------------- # 曲线匹配规则 num:线段长度 num_max:最大估计值 num = 3 num_max = 15 # 线段匹配算...
StarcoderdataPython
4828127
<reponame>sjsucohort6/openstack<gh_stars>0 # Copyright 2012 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
StarcoderdataPython
3254419
<reponame>hellwear/getCryptoPrice import get_course if __name__ == '__main__': get_course.getCurrency()
StarcoderdataPython
3349206
text_masked = "The capital of France is {mask}." text = "The capital of France is Paris." torch_model_name = "uclanlp/visualbert-nlvr2-coco-pre" paddle_model_name = "visualbert-nlvr2-coco-pre" import numpy as np import paddle import torch from paddlenlp.transformers import BertTokenizer as PDBertTokenizer from paddle...
StarcoderdataPython
3303263
<reponame>heidikira/startables-python import typing import numbers from pyscheme import atoms Number = typing.NewType('Number', numbers.Complex) Expression = typing.Union[Number, atoms.Symbol, typing.List['Expression']]
StarcoderdataPython
1625872
import torch import os import argparse from glob import glob import soundfile as sf from torchaudio.compliance.kaldi import mfcc from osdc.utils.oladd import overlap_add import numpy as np from osdc.features.ola_feats import compute_feats_windowed import yaml from train import OSDC_AMI parser = argparse.ArgumentParser...
StarcoderdataPython
126956
<gh_stars>0 print("Hello World") print("Hello Again") print("I Like typing this") print("This is fun.") print("Yay! Printing.") print("I'd much rather you 'not'.") print('I"said" do not touch this.') print("how to fix github")
StarcoderdataPython
1698463
<gh_stars>1-10 from PyQt5.QtWidgets import QDialog, QPushButton, QComboBox, QGridLayout, QStyle, QDoubleSpinBox, QWidget, QMessageBox from PyQt5.QtGui import QIcon from enum import Enum, auto def question_dialog( title: str, text: str, icon: QIcon=QMessageBox.Question, parent: QWidget=None, ...
StarcoderdataPython
1670722
import cobrakbase.core.kbasefba import cobrakbase.core.kbasebiochem import cobrakbase.core.kbasegenome import cobrakbase.core.kbasematrices from cobrakbase.core.model import KBaseFBAModel from cobrakbase.core.kbasebiochemmedia import KBaseBiochemMedia from cobrakbase.core.kbasefbafba import KBaseFBA from cobrakbase.cor...
StarcoderdataPython
1728558
<gh_stars>1-10 # Genetic algorithm to generate 6 sided shapes. Fitness score is determined by # regularity of angles. That is, it should generate a near perfect hexagon. # Chromosones are a list of XY coordinates. # More or less 6 genes, each with an XY pair defining the vertex. # Simple roulette wheel selection. # ...
StarcoderdataPython
165380
<reponame>appolimp/Dynamo_scripts import logging from base.wrapper import DB, doc from math import pi from .my_geom import MyPoints def calc_angle_to_ver_or_hor_side(main_vector, second_vector): """ Calc angle between main and second Then transform it to main vector or it perpendicular and make angle le...
StarcoderdataPython
4806007
<reponame>libfirm/sisyphus # Just import the other testsuites import empty import simple import variants import ctests.testsuite
StarcoderdataPython
3276960
<gh_stars>0 import datetime as dt from datetime import datetime import sys """ ---Trade Module-- 1. Query the Tick data from cassandra 2. Check Order type 3. LOGIC : Market Order 3.1 : Check if the row is a block or not not 3.2 : Find the current ask and bid price ...
StarcoderdataPython
4831537
from .base import MethodBuilderBase from collections import OrderedDict from itertools import chain class BuilderMethodBuilder(MethodBuilderBase): """ Many of Strata's immutable classes are joda beans constructed using a builder method. This method builder constructs Excel wrapper methods for tho...
StarcoderdataPython
3367566
<reponame>runzezhang/Data-Structure-and-Algorithm-Notebook<filename>lintcode/0993-array-partition-i.py # Description # Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possi...
StarcoderdataPython
1720400
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """NAS genotypes (adopted from DARTS).""" from collections import namedtuple Genotype = namedtuple('Genotype', 'nor...
StarcoderdataPython
125135
<filename>pycorrel/__init__.py<gh_stars>0 """Top-level package for pycorrel.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.1'
StarcoderdataPython
75612
<gh_stars>100-1000 # Copyright 2016 Rackspace # Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
StarcoderdataPython
1665261
import datetime from src import * import sys,getopt import os def align_init(allSymbols,variantTable=None): if variantTable: #設定使用 UnicodeTextScoreMatrix # 帶入異體字表 mUTSM=UnicodeTextScoreMatrix(alphabet=allSymbols,variantTable=variantTable) else: #設定使用 UnicodeTextScoreMatrix mUTSM=UnicodeTextScoreMatrix(alp...
StarcoderdataPython
185100
<gh_stars>0 from django.urls import path, include from rest_framework.urlpatterns import format_suffix_patterns from rest_framework.routers import DefaultRouter from . import views router = DefaultRouter() router.register(r"structures", views.StructureViewSet) urlpatterns = [ # API paths path( "impor...
StarcoderdataPython
3396952
import ssl ctx = ssl._create_unverified_context() # Noncompliant: by default hostname verification is not done ctx = ssl._create_stdlib_context() # Noncompliant: by default hostname verification is not done ctx = ssl.create_default_context() ctx.check_hostname = False # Noncompliant ctx = ssl._create_default_https_c...
StarcoderdataPython
1714644
def main(j, args, params, tags, tasklet): def chunks(l, n): """ Yield successive n-sized chunks from l. """ for i in xrange(0, len(l), n): yield l[i:i+n] page = args.page params.result = page if not page._hasmenu: page.addMessage("**error: Cannot create pag...
StarcoderdataPython
3350831
<gh_stars>10-100 from channels.generic.websocket import AsyncJsonWebsocketConsumer, AsyncWebsocketConsumer import json from channels.layers import get_channel_layer from asgiref.sync import async_to_sync from users.models import User from config_default import configs from qiniu import Auth class ChatConsumer(AsyncJs...
StarcoderdataPython
71165
<reponame>MuhammadSulaiman001/Autopilot<gh_stars>0 # # Sunny data # outFeaturesPath = "models/features_40_sun_only" # outLabelsPath = "models/labels_sun_only" # imageFolderName = 'IMG_sun_only' # features_directory = '../data/' # labels_file = '../data/driving_log_sun_only.csv' # modelPath = 'models/MsAutopilot_sun_onl...
StarcoderdataPython
3227340
<reponame>illume/numpy3k import os import genapi types = ['Generic','Number','Integer','SignedInteger','UnsignedInteger', 'Inexact', 'TimeInteger', 'Floating', 'ComplexFloating', 'Flexible', 'Character', 'Byte','Short','Int', 'Long', 'LongLong', 'UByte', 'UShort', 'UInt', 'ULong', ...
StarcoderdataPython
187918
<reponame>open-contracting/kingfisher-collect<filename>kingfisher_scrapy/spiders/mexico_inai_base.py import scrapy from kingfisher_scrapy.base_spider import SimpleSpider from kingfisher_scrapy.util import components, handle_http_error, join class MexicoINAIBase(SimpleSpider): """ This class makes it easy to ...
StarcoderdataPython
81585
from met_brewer.palettes import ( MET_PALETTES, COLORBLIND_PALETTES_NAMES, COLORBLIND_PALETTES, met_brew, export, is_colorblind_friendly ) MET_PALETTES COLORBLIND_PALETTES_NAMES COLORBLIND_PALETTES met_brew export is_colorblind_friendly
StarcoderdataPython
1650023
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # # _ooOoo_ # o8888888o # 88" . "88 # (| -_- |) # O\ = /O # ___/`---'\____ # . ' \\| |// `. # / \\||| : |||// \ # / _||||| -:- |||||- \ # | | \\\ - /// | | # | \_| ''\---/'' | | # \ .-\__ `-` ___/-. / # ___`. .' /--.--\ `. . __ # ."" '< `.___\_<|>_/___.' >'"". # | | : ...
StarcoderdataPython
3297279
# coding: utf-8 from __future__ import unicode_literals, absolute_import from . import Rule
StarcoderdataPython
1624738
from distutils.core import setup, Extension setup( name = 'rpi_hcsr04', version = '0.1.0', description = 'Control module hc-sr04 which connected to raspberry pi GPIO.', author = 'aozk', author_email = '<EMAIL>', url = 'https://github.com/aozk/rpi_hcsr04', ext_modules = [Extension('rpi_hcsr0...
StarcoderdataPython
1719547
# coding: utf-8 from __future__ import absolute_import from flask import json from six import BytesIO from swagger_server.models.model_class import ModelClass # noqa: E501 from swagger_server.test import BaseTestCase class TestClassController(BaseTestCase): """ClassController integration test stubs""" de...
StarcoderdataPython
1736834
<gh_stars>0 #! /usr/bin/env python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
StarcoderdataPython
1699831
<reponame>ouyang-w-19/decogo # NLP written by GAMS Convert at 04/21/18 13:51:01 # # Equation counts # Total E G L N X C B # 1497 1497 0 0 0 0 0 0 # # Variable counts # x b i ...
StarcoderdataPython
1671478
<gh_stars>10-100 ### Problem Set 1 # Qn 1 s = 'azcbobobegghakl' count = 0 for letter in s: if letter in 'aeiou': count += 1 print 'Number of vowels: ' + str(count) # Qn 2 s = 'azcbobobegghakl' count = 0 for i in range(len(s)): three_letters = s[i:i+3] if three_letters == 'bob': count ...
StarcoderdataPython
91157
<reponame>innofocus/haprestio import time from flask import jsonify from flask_restplus import Resource from flask_jwt_extended import create_access_token from . import get_token2, get_token2_m from ..data.accounts import Account from ..auth.jwt import admin_required @get_token2.route('/name=<string:name>/password=<s...
StarcoderdataPython
4840078
from .pointer import Pointer from typing import TypeVar, NoReturn from .exceptions import IsFrozenError import gc __all__ = ("FrozenPointer", "to_const_ptr") T = TypeVar("T") class FrozenPointer(Pointer[T]): def assign(self, _: Pointer[T]) -> NoReturn: """Point to a different address.""" ...
StarcoderdataPython
3377625
<gh_stars>0 #!/usr/bin/env python """Find labels that do not traverse through the volume. """ import sys import argparse import os from operator import itemgetter from itertools import groupby from scipy.ndimage.morphology import binary_dilation as scipy_binary_dilation import numpy as np from skimage.measure impor...
StarcoderdataPython
1650918
import time, os def main(): """Testing CLI for the robot """ #os.system('clear') while True: data = input("Remote control [r], Calibrate [c] Autonomous [a] or Exit [x]: ").lower() if data == "r": print("Waiting for remote control commands") time.sleep...
StarcoderdataPython
3293680
<gh_stars>10-100 #!/usr/bin/env python3 """ This script downloads the latest MTG card data from http://mtgjson.com/ and processes it to turn the highly-structured data there into a flat list of card names to descriptions formatted to send down the chat. """ import common common.FRAMEWORK_ONLY = True import sys import ...
StarcoderdataPython
1688357
from jinja2 import Environment, FileSystemLoader import json import os import shutil from datetime import datetime from fuzzyset import FuzzySet import os currentDir = os.getcwd() VARS = { "site-detail":os.path.normpath(currentDir+"/database/site-detail.json"), "gallery":os.path.normpath(currentDir+"/database...
StarcoderdataPython
126260
# Project Repository : https://github.com/robertapplin/N-Body-Simulations # Authored by <NAME>, 2020 from n_body_simulations.body_marker import BodyMarker from n_body_simulations.error_catcher import catch_errors from n_body_simulations.simulation_animator import SimulationAnimator from NBodySimulations import Vector2D...
StarcoderdataPython
3305466
<reponame>manaswinidas/oh-github-source """ Asynchronous tasks that update data in Open Humans. These tasks: 1. delete any current files in OH if they match the planned upload filename 2. adds a data file """ import logging import json import tempfile import requests import os from celery import shared_task from dj...
StarcoderdataPython
3305136
import requests import json import urllib import pandas as pd if __name__ == '__main__': with open('appcreds.txt', 'r') as credfile: uid, secret = credfile.read().splitlines() r = requests.post("https://api.intra.42.fr/oauth/token", data={'grant_type': 'client_credentials', 'client_id': uid, 'client_secret': secr...
StarcoderdataPython
1631292
''' Author: Ligcox Date: 2021-04-06 15:20:21 LastEditors: Ligcox LastEditTime: 2021-08-20 16:15:36 Description: Program decision level, all robot decision information should be processed by this module and then sent. Apache License (http://www.apache.org/licenses/) Shanghai University Of Engineering Science Copyright ...
StarcoderdataPython
10457
<filename>model/net_qspline_A.py<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Wed Oct 21 19:52:22 2020 #Plan A @author: 18096 """ '''Defines the neural network, loss function and metrics''' #from functools import reduce import torch import torch.nn as nn from torch.nn.functional import pad from torc...
StarcoderdataPython
85557
import logging import os import pickle import sys from functools import partial from os.path import join, exists, basename, dirname try: from typing import Dict except: pass try: import notify2 as notify notify.init('Youtube Playlist') except: pass import unicodedata from youtube_dl import Youtube...
StarcoderdataPython
156323
import os from subprocess import call from sys import argv, exit import numpy as np import scipy.io as sio (STATE_IDLE, STATE_READTEX, STATE_READFACES) = (0, 1, 2) #Extract the texture coordinates and faces from WRL files #in the BU-3DFE dataset def saveTexCoordsAndFaces(filePrefix): fHandle = open("%s.wrl"%filePref...
StarcoderdataPython
76064
""" [2015-04-29] Challenge #212 [Intermediate] Animal Guess Game Description: There exists a classic game which I knew by the name of "Animal". The computer would ask you to think of an animal. If would then ask a bunch of questions that could be answered with a Yes or No. It would then make a guess of what animal yo...
StarcoderdataPython
4839991
def isNaN(Nummer): try: Nummer = int(Nummer) return False except: return True def MtxCurrencyConverter(VBucks): VBucks = int(VBucks) Price = int(0) while VBucks > 13500 or VBucks == 13500: Price += 99.99 VBucks -= 13500 while VBucks > 750...
StarcoderdataPython
1797666
""" Info objects """ import numbers import numpy import autofile.info from autofile.system._util import utc_time as _utc_time def conformer_trunk(nsamp, tors_ranges): """ conformer trunk information :param nsamp: the number of samples :type nsamp: int :param tors_ranges: sampling ranges [(start, end)...
StarcoderdataPython
1760
import os import numpy as np import cv2 import albumentations from PIL import Image from torch.utils.data import Dataset from taming.data.sflckr import SegmentationBase # for examples included in repo class Examples(SegmentationBase): def __init__(self, size=256, random_crop=False, interpolation="bicubic"): ...
StarcoderdataPython
3370725
<filename>{{ cookiecutter.repo_name }}/src/visualization/visualize.py # -*- coding: utf-8 -*- import click from dotenv import find_dotenv, load_dotenv from src.utils import config_logging, time_func from src.features.build_features import read_feature_vector, get_feature_names, get_label_column_name import logging impo...
StarcoderdataPython
1637017
<gh_stars>1000+ from plugin.core.helpers import regex as re import logging import os import shutil log = logging.getLogger(__name__) class StorageHelper(object): base_names = [ 'plug-ins', 'plug-in support', 'trakttv.bundle' ] framework_patterns = re.compile_list([ # Win...
StarcoderdataPython
1767005
# 🚨 Don't change the code below 👇 year = int(input("Which year do you want to check? ")) # 🚨 Don't change the code above 👆 #Write your code below this line 👇 # #Checking if math checks out # #If year is evenly divisible by 4 # if (year/4).is_integer(): # print("Is leap") # else: # print("Is not leap") # ...
StarcoderdataPython
1708033
""" Command-line interface for the bib_lookup package. """ import argparse from pathlib import Path from typing import Union try: from bib_lookup.bib_lookup import BibLookup except ImportError: # https://gist.github.com/vaultah/d63cb4c86be2774377aa674b009f759a import sys level = 1 global __packa...
StarcoderdataPython
1769159
import csv import pandas as pd from collections import Counter from nltk.tokenize import RegexpTokenizer import time def getFoodIdDf(description, foodIdFilePath="foodData/input_food.csv"): colList = ["sr_description", "fdc_id"] df = pd.read_csv(foodIdFilePath, usecols=colList) tokenizer = RegexpTokenize...
StarcoderdataPython
70652
<filename>cold_posterior_bnn/core/diagnostics.py # coding=utf-8 # Copyright 2021 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 License at # # http://www.apache.org/lic...
StarcoderdataPython
1644934
<reponame>TheBugYouCantFix/wiki-reddit-bot<filename>sentences.py<gh_stars>10-100 from datetime import datetime # Reddit markdown is used in this string comment_reply = f"\n\n\n\n*This comment was left automatically (by a bot)." \ f" If I don't get this right, don't get mad at me, I'm still learning...
StarcoderdataPython
3214108
<reponame>lite3/Adbtool import sys def raise_error(err, code=1): sys.exit(err)
StarcoderdataPython
82475
''' Utility functions to analyze particle data. @author: <NAME> <<EMAIL>> Units: unless otherwise noted, all quantities are in (combinations of): mass [M_sun] position [kpc comoving] distance, radius [kpc physical] velocity [km / s] time [Gyr] ''' # system ---- from __future__ import absolute_imp...
StarcoderdataPython
74480
<reponame>mahajrod/MAVR<gh_stars>1-10 #!/usr/bin/env python __author__ = '<NAME>' import argparse from RouToolPa.Tools.Annotation import AUGUSTUS parser = argparse.ArgumentParser() parser.add_argument("-i", "--input_gff", action="store", dest="input_gff", required=True, help="Input AUGUSTUS GFF fi...
StarcoderdataPython
70915
<filename>adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/gizmo_eink_simpletest.py<gh_stars>10-100 # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT import time import displayio from adafruit_gizmo import eink_gizmo display = eink_gizmo.EInk_G...
StarcoderdataPython
3366575
from setuptools import setup, find_packages setup( name='ynab_bank_import', version='0.1dev0', author='<NAME>', author_email='<EMAIL>', description='YNAB bank import conversion scripts', long_description=( open('README.md').read() + '\n' + open('HISTORY.txt').read()), licen...
StarcoderdataPython
3208657
n1 = int(input('digite um numero: ')) s1 = n1 - 1 s2 = n1 + 1 #dessa forma print('antecessor do numero é {} \n sucessor do numero é {}'.format(s1,s2)) #ou print('analisando o numero {}, seu antecessor é {}, e seu sucessor é {}'.format(n, (n-1), (n+1))) #eliminando o: #s1 = n1 - 1 #s2 = n1 + 1
StarcoderdataPython
1698151
#!flask/bin/python ## Main to run our web application from app import app app.run(debug=True)
StarcoderdataPython
100943
<filename>Dataset/Leetcode/train/78/546.py class Solution: def XXX(self, nums: List[int]) -> List[List[int]]: if not nums: return [[]] rec = [] res = self.XXX(nums[1:]) for r in res: rec.append(r) rec.append([nums[0]]+r) return re...
StarcoderdataPython
1644727
<reponame>Springerle/debianized-pypi-mold #! /usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable= # mkvenv: no-deps """ Debian packaging for the {{ cookiecutter.pypi_package }} package. | Copyright © {{ cookiecutter.year }}, {{ cookiecutter.full_name }} | See LICENSE for details. This puts the ...
StarcoderdataPython
4810629
<filename>cccom.py<gh_stars>1-10 """ SCons tool to generate a JSON Compilation Database file, specified in: https://clang.llvm.org/docs/JSONCompilationDatabase.html The file is a listing with a compilation command line for each translation unit for a target Syntax: CompileCommands('compile...
StarcoderdataPython
3268011
<reponame>The-Academic-Observatory/observatory-reports # Copyright 2020 Curtin University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
StarcoderdataPython
3357761
<reponame>grantperry/majortom_gateway_package<filename>setup.py import setuptools VERSION = "0.0.7" with open("README.md", "r") as readme: readme_content = readme.read() setuptools.setup( name="majortom_gateway", version=VERSION, author="Kubos", author_email="<EMAIL>", description="A package...
StarcoderdataPython
23662
from selenium import webdriver import time chromedriver = "C:/Users/deniz/chromedriver/chromedriver" driver = webdriver.Chrome(chromedriver) driver.get('http://127.0.0.1:8000/') dashboard = '//*[@id="accordionSidebar"]/li[1]/a' sectors_1 = '//*[@id="sectors"]' sectors_1_element = '//*[@id="sectors"]/option[4]' add_s...
StarcoderdataPython
3369247
import numpy import matplotlib.pyplot as plt from slowfast.visualization.gradcam_utils import * import imageio import cv2 from pathlib import Path path = Path('/mnt/data/ni/ahenkan/SlowFast') path.mkdir(parents=True, exist_ok=True) ###Loading the localization maps #load_localization_map = numpy.load(path/f'localiz...
StarcoderdataPython
1603501
<reponame>pixelpassion/django-saas-boilerplate from django.conf import settings from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth.password_validation import validate_password from django.contrib.auth.tokens import default_token_generator from django.utils.encoding import force_text from ...
StarcoderdataPython
141290
import socket import network import wifi_secrets import machine import uos import usys import gc import utime import ure import hashlib from sparkle import Sparkle import ubinascii import uio from irq_counter import IRQCounter from bme280_sensor import BME280Sensor from dht22_sensor import DHT22Sensor from mhz19_sensor...
StarcoderdataPython