id
stringlengths
2
8
text
stringlengths
16
264k
dataset_id
stringclasses
1 value
320836
<gh_stars>1-10 """ NoxRating Main Logic """ if __name__ == "__main__": from noxrating import noxrating noxrating.main()
StarcoderdataPython
8047306
import os from unittest import SkipTest from unittest.mock import Mock, call, patch from django.conf import settings from django.test import TestCase try: import qgis # noqa except ImportError: raise SkipTest("Skipping all QGIS tests because it's not installed.") from eventkit_cloud.utils.qgis_utils import ...
StarcoderdataPython
1657413
<gh_stars>0 import secrets, sys, os, getopt, struct import Crypto from Crypto.Cipher import AES from getpass import getpass from hashlib import sha256 from lib import to_bytes, to_str, hash_password, wipe, prompt_password, get_key Version = 1 KEY_SIZE = 32 Verbose = False def encrypt(key, inp_fn, out_fn, remove_in...
StarcoderdataPython
218686
#!/usr/bin/python # Uses google spreadsheets to store data. # Google writing leverages gspread library. See: https://github.com/burnash/gspread # But the oauth stuff is not quite right.... # Requires oauth2 authorisation. # That means we need to create a security key file using google ui. # This is pointed to below ...
StarcoderdataPython
388580
<filename>mobiletrans/settings/__init__.py<gh_stars>1-10 from mobiletrans.settings.main import *
StarcoderdataPython
3209253
<gh_stars>0 # File: ciscoumbrella_consts.py # # Copyright (c) 2021-2022 Splunk Inc. # # 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 # # Unle...
StarcoderdataPython
5063529
import sys import unittest from flask import Flask from test_base import * if sys.version_info > (2, 6): from test_decorator_registration import decorator_registration setattr(TestCaseContextIndependent, 'test_decorator_registration', decorator_registration) def suite(): suite = unittest.Tes...
StarcoderdataPython
5135232
""" """ from .width import wcwidth, wcswidth # noqa __all__ = ('wcwidth', 'wcswidth',)
StarcoderdataPython
12853503
<filename>backtoshops/notifs/views.py # -*- coding: utf-8 -*- ############################################################################# # # Copyright © <NAME> # contact: <EMAIL> # # This software is a collection of webservices designed to provide a secure # and scalable framework to build e-commerce websites. # # ...
StarcoderdataPython
125648
<reponame>graykode/nlpblock from nlpblock.layer import RNN from nlpblock.layer.GRU import GRU from nlpblock.layer.LSTM import LSTM from nlpblock.layer.Attention import Attention from nlpblock.layer.AttentionOne import AttentionOne from nlpblock.layer.AttentionTwo import AttentionTwo from nlpblock.layer.AttentionTwo imp...
StarcoderdataPython
1892927
<gh_stars>0 # coding: utf-8 # Temp1, Temp2 Temp3 e Temp4 são temperaturas medidas em diferentes partes da planta # Target representa o estado da qualidade da amostra (temp1, temp2, temp3 e temp4) # In[20]: import pandas as pd import numpy as np from matplotlib import pyplot as plt #p1_data_test_df = pd.read_csv(...
StarcoderdataPython
3201561
<gh_stars>1000+ """Constants for the Garages Amsterdam integration.""" DOMAIN = "garages_amsterdam" ATTRIBUTION = f'{"Data provided by municipality of Amsterdam"}'
StarcoderdataPython
5062982
''' 存在重复元素 给定一个整数数组,判断是否存在重复元素。 如果存在一值在数组中出现至少两次,函数返回 true 。如果数组中每个元素都不相同,则返回 false 。 ''' from typing import List ''' 思路:哈希表 如果重复的元素出现,返回True ''' class Solution: def containsDuplicate(self, nums: List[int]) -> bool: allset = set() for n in nums: if n in allset: return ...
StarcoderdataPython
4961127
# # ------------------------------------------------------------------------- # Copyright (c) 2015-2017 AT&T Intellectual Property # Copyright (C) 2020 Wipro Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ma...
StarcoderdataPython
6636632
<filename>space/const.py from util import * # gravitational constant G = 6.673e-11 # gravitational acceleration at earth surface g = 9.81 # stefan-boltzmann constant sigma = 5.67e-8 GM=namespace('Gravitational constant times body mass [???]') GM.sun = 1.327e20 GM.earth = 3.986e14 GM.moon = 4.903e12 GM.mercury = 2.0...
StarcoderdataPython
8167559
<reponame>henryleberre/MFC-develop<filename>samples/1D_exp_bubscreen/case.py #!/usr/bin/env python3 import math import json x0 = 17.E-05 p0 = 101325. rho0 = 1.E+03 c0 = math.sqrt( p0/rho0 ) patm = 1. #water props ## AKA little \gamma (see coralic 2014 eq'n (13)) n_tait = 7.1 ## AKA little \pi(s...
StarcoderdataPython
3565093
#Trabajo con clases y objetos #Los objetos y las clases son importantes cuando se trata de trabajar en el #lenguaje Python. Los objetos ayudan a definir las diferentes partes del código #y mantenerlos todos organizados y fáciles de entender, mientras que las clases #van a funcionar como los contenedores de los objetos ...
StarcoderdataPython
8161232
/home/runner/.cache/pip/pool/f3/c8/d9/1f377645cbb76e873071fee60b3d23efac83c822e9b7867e11df7ae58f
StarcoderdataPython
110260
<reponame>blackw1ng/FritzBox-monitor #!/opt/bin/python3 from fritzconnection import FritzConnection import sys FRITZBOX_USER = "monitoring" FRITZBOX_PASSWORD = "<PASSWORD>" try: fc = FritzConnection(address='192.168.178.1', user=FRITZBOX_USER, password=<PASSWORD>, timeout=2.0) except BaseException: print("C...
StarcoderdataPython
3459481
"""kytos - The kytos command line. You are at the "bug-report" command. Usage: kytos bug-report kytos bug-report -h | --help Options: -h, --help Show this screen. """ import sys from docopt import docopt from kytos.cli.commands.bug_report.api import BugReportAPI from kytos.utils.exceptions imp...
StarcoderdataPython
5048463
<filename>docs_src/options/autocompletion/tutorial006.py from typing import List import typer def main(name: List[str] = typer.Option(["World"], help="The name to say hi to.")): for each_name in name: typer.echo(f"Hello {each_name}") if __name__ == "__main__": typer.run(main)
StarcoderdataPython
9625220
<reponame>ua-data7/placeholder from datetime import datetime from astm.mapping import ( Record, ConstantField, DateTimeField, IntegerField, NotUsedField, TextField, RepeatedComponentField, Component ) QuidelHeaderRecord = Record.build( ConstantField(name='type', default='H'), # 1 RepeatedComponentFi...
StarcoderdataPython
6682230
<filename>setup.py from setuptools import setup, find_packages from os.path import dirname, realpath, join CURRENT_DIR = dirname(realpath(__file__)) with open(join(CURRENT_DIR, "README.md")) as long_description_file: long_description = long_description_file.read() setup( name="Flask-RRBAC", version="0.3....
StarcoderdataPython
222653
from pyspark import SparkContext, SparkConf from pyspark.sql import SQLContext, Row conf = SparkConf().setAppName("clo2016") sc = SparkContext(conf=conf) sqlc = SQLContext(sc) df = sqlc.read.format('com.databricks.spark.csv').options(header='true', inferschema='true').load("/home/oxclo/datafiles/practices/*.csv") p...
StarcoderdataPython
1796781
# -*- coding: utf8 -*- import sys from traceback import format_exception from tuttle.error import TuttleError from tuttle.report.dot_repport import create_dot_report from tuttle.report.html_repport import create_html_report from pickle import dump, load from tuttle.workflow_runner import WorkflowRunner, TuttleEnv from...
StarcoderdataPython
3420486
<reponame>jscherer26/Icarra<gh_stars>1-10 # Copyright (c) 2006-2010, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright ...
StarcoderdataPython
3212333
<gh_stars>0 import json import os.path def load_json( filename, **options ): debug = False if 'debug' in options: debug = True if debug: print("UTIL: DEBUG: Config file: "+filename+"\n" ) data = "" fd = None if not os.path.exists( filename ) : raise RuntimeError( "File "+filename+" coul...
StarcoderdataPython
3451697
<filename>orttraining/orttraining/python/training/ortmodule/__init__.py<gh_stars>10-100 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # ------------------------------------------------------------...
StarcoderdataPython
283320
from flask import Flask from flask import Flask, flash, redirect, render_template, request, session, abort from flask_googlemaps import GoogleMaps from flask_googlemaps import Map import os import requests import json import jwt app = Flask(__name__) app.config['GOOGLEMAPS_KEY'] = "<KEY>" app.secret_key = os.urandom(1...
StarcoderdataPython
9730172
from itertools import product def accumulate_products(max_turns, numbers=None): numbers = [str(digit) for digit in numbers] accumulators = [] for repetition in range(1, max_turns + 1): accumulators.extend(product(numbers, repeat=repetition)) accumulated_combinations = [int(''.join(item)) for it...
StarcoderdataPython
3297512
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import pytest from identify import extensions @pytest.mark.parametrize('extension', extensions.EXTENSIONS) def test_extensions_have_binary_or_text(extension): tags = extensions.EXTENSIONS[extension] assert...
StarcoderdataPython
5072918
<filename>append.py none = 'aa' s = [1,2,3,none] p = 5,6 print(s.append(p)) print(s) print(p)
StarcoderdataPython
6701396
<gh_stars>0 import gym from IPython import display import matplotlib import matplotlib.pyplot as plt import gym_minigrid from gym import wrappers from time import time env = gym.make('MiniGrid-GridCity-4S30Static-v0') env.render() env = wrappers.Monitor(env, "./gym-results", force=True) img = env.reset() for _ in rang...
StarcoderdataPython
11299829
<gh_stars>1-10 import sys from eosapi import Client from haiku_node.config.config import UnificationConfig from haiku_node.blockchain_helpers.eos import eosio_account from haiku_node.validation.validation import UnificationAppScValidation def run_test(requesting_app): conf = UnificationConfig() eos_client ...
StarcoderdataPython
11363785
from typing import List, Optional from libs.enums import Intervention from libs.datasets.dataset_utils import AggregationLevel from libs import us_state_abbrev from libs import base_model import pydantic import datetime """ CovidActNow API Documentation at https://github.com/covid-projections/covid-data-model/tree/ma...
StarcoderdataPython
5181646
# --------------------------------------------------------------------------- # Licensed under the MIT License. See LICENSE file for license information. # --------------------------------------------------------------------------- from __future__ import annotations import asyncio import os import token import tokeniz...
StarcoderdataPython
35214
<reponame>KanataIZUMIKAWA/TXTer # Generated by Django 3.1.4 on 2021-01-05 03:33 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Posts', fields=[ ...
StarcoderdataPython
1601245
import numpy as np from .Observable import Subject class ObservableArray(np.ndarray, Subject): def __init__(self, *args, **kwargs): Subject.__init__(self) np.ndarray.__init__(self) def _notify(self, to_return): """ if hasattr(to_return, "_observers") and hasattr(sel...
StarcoderdataPython
1984599
# if condition: # pass # else: # pass # if condition: # pass # elif expression: # pass # else: # pass # if condition: # pass # pass if condition else pass xa = "XA" # if xa == "XA": # print("Yo!") # else: # print("No!") # print("Yo!") if xa == "XA" else print("No!") # print("Yo!") if xa == "XA" e...
StarcoderdataPython
8181262
<reponame>aticie/SATRN<gh_stars>0 """ Copyright (c) 2020-present NAVER Corp. MIT license Usage: python train.py --config_file=<config_file_path> """ import logging import os import random import time from logging import handlers, StreamHandler import fire import numpy as np import tensorflow as tf from psutil import...
StarcoderdataPython
3384980
class Node: def __init__(self, data): self.data = data self.left = None self.right = None # A utility function to insert a new node with given data in BST and find its successor def insert(node, data): global succ # If the tree is empty, return a new node ...
StarcoderdataPython
4957763
for _ in range(0,10): print("Hello World!!!!!!!!!.")
StarcoderdataPython
314611
import importlib import os import matplotlib.pyplot as plt import torch import numpy as np import dataloaders.mnist from ifaces import DownloadableDataset from modules.iwae import IWAE from modules.vae import VAE from utils_clone.pytorch import reshape_and_tile_images def load_checkpoint(checkpoint_fname): stat...
StarcoderdataPython
9613261
<reponame>DimitriPapadopoulos/nmrglue #! /usr/bin/env python import nmrglue as ng # read in the Agilent data dic, data = ng.varian.read("agilent_2d") # Set the spectral parameters udic = ng.varian.guess_udic(dic, data) # Direct dimension # Indirect dimension udic[1]['size'] = 1500 ; ud...
StarcoderdataPython
3232102
<reponame>xdfcfc0xa/THMC-Challenge-Server import os from datetime import datetime production = os.getenv("PRODUCTION", None) is not None BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ctf_name = "TMHC" eligibility = "In order to be able to join this server you will need a team key for one of the teams allowed ...
StarcoderdataPython
8171529
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/vision.models.pooling.ipynb (unless otherwise specified). from __future__ import annotations __all__ = ['BlurPool', 'MaxBlurPool'] # Cell #nbdev_comment from __future__ import annotations from kornia.filters import BlurPool2D, MaxBlurPool2D from ...imports import *...
StarcoderdataPython
8167634
<gh_stars>0 import atexit import RPi.GPIO as GPIO import time # PIN Setup -- set this to whatever pins you have the LED hooked up to red_pin = 20 green_pin = 21 blue_pin = 22 min = 0 #start PWM at 0% duty cycle max = 100 #maximum durty cycle # GPIO Infrastructure for the LED GPIO.setmode(GPIO.BCM) GPIO...
StarcoderdataPython
4928712
<reponame>BlazeCode2/haddoc2 #!/usr/bin/env python # -*- coding: UTF-8 -*- ##---------------------------------------------------------------------------- ## Title : quartus ## Project : Haddoc2 ##---------------------------------------------------------------------------- ## File : quartus.py ## Author ...
StarcoderdataPython
6630891
<gh_stars>1-10 from . import rman_operators_printer from . import rman_operators_view3d from . import rman_operators_render from . import rman_operators_rib from . import rman_operators_nodetree from . import rman_operators_collections from . import rman_operators_editors from . import rman_operators_stylized from . im...
StarcoderdataPython
8115313
import numpy as np def normalize_to_range(array, R): """Returns array normalized to range R.""" array = array - np.min(array) + R[0] return array * (R[1] / np.max(array)) def bound_errors(x, x1, x2): if x1 >= x2: raise ValueError('x2 must be greater than x1') if x1 >= x[-1]: raise...
StarcoderdataPython
4847144
#!/usr/bin/env python '''Class for plotting simulation data. @author: <NAME> @contact: <EMAIL> @status: Development ''' # Base python imports import numpy as np import os import scipy.stats import scipy.signal as signal import warnings import verdict import matplotlib matplotlib.use('PDF') import matplotlib.pyplot a...
StarcoderdataPython
12850483
<filename>swc/cli_repositories.bzl "@generated by @aspect_rules_js//npm/private:npm_translate_lock.bzl from pnpm lock file @aspect_rules_swc@aspect_rules_swc//swc:pnpm-lock.yaml" load("@aspect_rules_js//npm:npm_import.bzl", "npm_import") def npm_repositories(): "Generated npm_import repository rules corresponding...
StarcoderdataPython
24203
#!venv/bin/python # coding=UTF-8 # -*- coding: UTF-8 -*- # vim: set fileencoding=UTF-8 : """ Double-deck bid euchre Implementation is similar to the rules given by <NAME> https://www.pagat.com/euchre/bideuch.html Notable differences (to match how I learned in high school calculus) include: * Minimum bid of 6 (w...
StarcoderdataPython
9712723
<reponame>jiayushe/hnr-2021<gh_stars>1-10 from .healthcheck import HealthCheck from .user import SignUp, SignIn, SignOut __all__ = ["HealthCheck", "SignUp", "SignIn", "SignOut"]
StarcoderdataPython
125390
<filename>hc/front/tests/test_update_priority.py<gh_stars>0 from hc.api.models import Check from hc.test import BaseTestCase class UpdatePriorityTestCase(BaseTestCase): def setUp(self): super(UpdatePriorityTestCase, self).setUp() self.check = Check(user=self.alice) self.check.save() ...
StarcoderdataPython
201193
<reponame>korenlev/calipso-cvim ############################################################################### # Copyright (c) 2017-2020 <NAME> (Cisco Systems), # # <NAME> (Cisco Systems), <NAME> (Cisco Systems) and others # # ...
StarcoderdataPython
9725208
<reponame>affinis-lab/car-detection-module import cv2 from keras.callbacks import ModelCheckpoint from keras.models import Model from keras.layers import Input, Flatten, Dense, Reshape, Lambda from keras.layers import Conv2D, BatchNormalization, LeakyReLU, MaxPooling2D, Dropout, Activation, \ GlobalAveragePooling2D...
StarcoderdataPython
5055065
<reponame>Helilysyt/tensorlayer ''' Twin Delayed DDPG (TD3) ------------------------ DDPG suffers from problems like overestimate of Q-values and sensitivity to hyper-parameters. Twin Delayed DDPG (TD3) is a variant of DDPG with several tricks: * Trick One: Clipped Double-Q Learning. TD3 learns two Q-functions instead ...
StarcoderdataPython
3420388
import random def test_shift_left(): n = random.randint(1, 100) my_list = [random.randint(1, 100) for _ in range(n)] my_list_before = my_list.copy() for i in range(n): my_list.append(my_list.pop(0)) assert my_list_before == my_list # def test_key_schedule_core(): # pass # def test_e...
StarcoderdataPython
4971036
# IMPORTS ################################################################################ IMPORTS # # Standard library import http import datetime import json import unittest import time # Installed import pytest import marshmallow # Own from dds_web import db from dds_web.database import models import tests # CO...
StarcoderdataPython
8168328
<reponame>myles-novick/pysplice """ A set of utility functions for calculating drift of deployed models """ import datetime as datetime import matplotlib.pyplot as plt from datetime import datetime import pyspark.sql.functions as f from itertools import count, islice import warnings try: from pyspark_dist_explore ...
StarcoderdataPython
1956584
<reponame>brianleungwh/signals<filename>signals/__init__.py from signals.main import run_signals __all__ = ['run_signals']
StarcoderdataPython
390851
<reponame>abh/salt ''' Create virtualenv environments ''' # Import python libs from salt import utils __opts__ = { 'venv_bin': 'virtualenv' } __pillar__ = {} def create(path, venv_bin=None, no_site_packages=False, system_site_packages=False, distribute=False, clear=False,...
StarcoderdataPython
8002131
<filename>tests/performance_tests/common.py import argparse from enum import Enum SEC_IN_A_YEAR = 3600 * 24 * 365 class TimeUnit(Enum): second = 's' year = 'y' def get_avg_events_sec(avg_events, time_unit): return avg_events / SEC_IN_A_YEAR if TimeUnit(time_unit) == TimeUnit.year else avg_events def ...
StarcoderdataPython
9607273
<reponame>anirudhakulkarni/codes<filename>codeforces/anirudhak47/1389/C.py def ans(s,x): ana=0 bo=0 for i in range(len(x)): if(bo==0): if x[i]==s[0]: ana+=1 bo=1 continue if(bo==1): if x[i]==s[1]: ...
StarcoderdataPython
4915574
import keras from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten, Reshape from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D from keras.preprocessing.image import ImageDataGenerator from keras import regul...
StarcoderdataPython
12812789
import re import sublime import sublime_plugin CLASSES = { 'ActionBar': 'android.app.ActionBar', 'Activity': 'android.app.Activity', 'AlertDialog': 'android.app.AlertDialog', 'ArrayAdapter': 'android.widget.ArrayAdapter', 'ArrayList': 'java.util.ArrayList', 'Build': 'android.os.Build', 'B...
StarcoderdataPython
6445066
#!/usr/bin/env python # SCADA Simulator # # Copyright 2018 Carnegie Mellon University. All Rights Reserved. # # NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPL...
StarcoderdataPython
9660784
<filename>djangorest_alchemy/tests/test_apibuilder.py import unittest import mock from djangorest_alchemy.apibuilder import APIModelBuilder class TestAPIBuilder(unittest.TestCase): def test_urls(self): """ Test basic urls property """ class Model(object): pass ...
StarcoderdataPython
327865
import pywaves as pw """ pywaves is an open source library for waves. While it is not as stable as REST API, we leave the test here if integration is desired for future dexbot cross-exchange strategies. """ if __name__ == '__main__': try: # set the asset pair WAVES_BTC = pw.AssetPair(pw.WAVES, pw...
StarcoderdataPython
8056688
# Delfino Mercenary (9390232)
StarcoderdataPython
3234100
from django.db import models from psqlextra.fields import HStoreField from psqlextra.expressions import HStoreRef from .fake_model import get_fake_model def test_annotate_hstore_key_ref(): """Tests whether annotating using a :see:HStoreRef expression works correctly. This allows you to select an indivi...
StarcoderdataPython
8142892
""" FBDTools library - icecream package This module contains helper methods that generate plot objects useful for drawing PD/ICE/ALE plots using data objects containing features, targets and predictions """ from typing import Any, Dict, List, Optional, Union import numpy as np import pandas as pd import plotly.graph_...
StarcoderdataPython
3357421
<reponame>pavalucas/Any2Some __author__='thiagocastroferreira' import argparse from models.bartgen import BARTGen from models.bert import BERTGen from models.gportuguesegen import GPorTugueseGen from models.t5gen import T5Gen from models.gpt2 import GPT2 from torch.utils.data import DataLoader, Dataset import nltk fro...
StarcoderdataPython
1730343
<filename>src/rcpicar/car/NetworkStatisticsMessage.py from __future__ import annotations from ..message import IMessage separator = ',' class NetworkStatisticsMessage(IMessage): def __init__(self, expire_receive_count: int, receive_count: int, timeout_receive_count: int) -> None: self.expire_receive_coun...
StarcoderdataPython
6410096
<reponame>DinoSubbu/SmartEnergyManagementSystem import requests import json from sqlalchemy import Column, Text, Integer, Float, ForeignKey, DateTime from datetime import datetime class WeatherAPI: def __init__(self, api_key="3d34a9a9b0e544269a3ddbb97ec89ba7", api_current="https://api.weatherbit.io/v2.0/current", ...
StarcoderdataPython
9753343
<filename>shimmer/apps/BtStream/python/getShimmerVersion.py<gh_stars>0 #!/usr/bin/python import sys, struct, array, time, serial def wait_for_ack(): ddata = "" ack = struct.pack('B', 0xff) while ddata != ack: ddata = ser.read(1) return if len(sys.argv) < 2: print "no device specified" print "...
StarcoderdataPython
12841997
<reponame>matteocarde/asp2logic class Result: name: str optimum: int status: str time: float def __init__(self, name, optimum, status, time): self.name = name self.optimum = optimum self.status = status self.time = time
StarcoderdataPython
3454790
from os import path from setuptools import setup, find_packages here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'requirements.txt')) as f: requirements = f.readlines() requirements = [requirement.replace('\n', '') for requirement in requirements] setup( name='sshmanager', version='...
StarcoderdataPython
3526078
<gh_stars>0 from django.apps import AppConfig class KstudentConfig(AppConfig): name = 'kstudent'
StarcoderdataPython
1839461
from enum import Enum, unique @unique class TriviaQAType(Enum): TEST = 1
StarcoderdataPython
3220372
<gh_stars>0 from nomenklatura.model.dataset import Dataset from nomenklatura.model.entity import Entity from nomenklatura.model.account import Account __all__ = [Dataset, Entity, Account]
StarcoderdataPython
9678176
<filename>how-to-use-azureml/azure-synapse/start_script.py from pyspark.sql import SparkSession import argparse parser = argparse.ArgumentParser() parser.add_argument("--input", default="") parser.add_argument("--output", default="") args, unparsed = parser.parse_known_args() spark= SparkSession.builder.get...
StarcoderdataPython
11364619
<gh_stars>0 from typing import NamedTuple from .tomato_constants import * class CropStates(NamedTuple): carbohydrate_amount_Buf: float carbohydrate_amount_Fruits: [float]*FRUIT_DEVELOPMENT_STAGES_NUM number_Fruits: [float]*FRUIT_DEVELOPMENT_STAGES_NUM carbohydrate_amount_Leaf: float carbohydrate_...
StarcoderdataPython
11233415
<reponame>ICOS-Carbon-Portal/jupyter<filename>notebooks/icos_jupyter_notebooks/tools/visualization/bokeh_help_funcs/secondary_yaxis.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Oct 14 16:40:00 2020 Function that aligns primary with secondary y-axis in a Bokeh time-series plot. """ _...
StarcoderdataPython
269256
<filename>todo/views/del_list.py<gh_stars>100-1000 from django.contrib import messages from django.contrib.auth.decorators import login_required, user_passes_test from django.core.exceptions import PermissionDenied from django.http import HttpResponse from django.shortcuts import get_object_or_404, redirect, render fr...
StarcoderdataPython
9793378
<filename>lambdata_vdeb/__init__.py """ lambdata - a collection of encouragement """ import pandas as pd import numpy as np import random from random import seed from random import randint from lambdata_vdeb.dataframe_Helper import report_missing_values TEST = pd.DataFrame(np.ones(10))
StarcoderdataPython
6605472
<reponame>alffore/tileimagen import requests import cv2 import numpy as np def analizaHisto(imagen): """ Analiza el histograma de imagenes :param imagen: :return: """ hist = cv2.calcHist([imagen], [0, 1, 2], None, [8, 8, 8], [0, 256, 0, 256, 0, 256]) hist = cv2.normalize(hist, hist).flatte...
StarcoderdataPython
3411293
from typing import List from torch import Tensor from torch.nn import Module class ViewChange(Module): def __init__(self, new_size: List[int]): super().__init__() self.new_size = new_size def forward(self, x: Tensor): n = x.shape[0] return x.view([n] + self.new_size) class ...
StarcoderdataPython
3526890
#Find dynamically allocated string structures in Go binaries. # type stringStruct struct { # str unsafe.Pointer # len int # } #Different instructions per architecture. Multiple solutions are possible. #Future ToDo: add newly discovered instruction sequences. #@author <EMAIL> #@category goscripts #@keybinding #...
StarcoderdataPython
8145718
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2018-01-02 16:16 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('accounts', '0001_initial'), ('invites', '0002_auto_...
StarcoderdataPython
12828909
from django.conf.urls import include, url from django.conf.urls.i18n import i18n_patterns from django.conf import settings from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf.urls.static import static from apps.app import application admin.autodiscove...
StarcoderdataPython
6426239
<filename>wms/models.py<gh_stars>10-100 # Keeping manage.py happy
StarcoderdataPython
1938173
from tkinter import * from tkinter.tix import TEXT from urllib import response import requests import ast import subprocess import os from tkinter import messagebox import pyttsx3 from pathlib import Path # from tkinter.tix import * # global so it can be accessed in the actions.py file when needed # global category # g...
StarcoderdataPython
5111535
""" This class provides functionality for managing a generig sqlite or mysql database: * reading specific fields (with the possibility to filter by field values) * storing calculated values in the dataset Created on May 11 2018 @author: <NAME> """ from __future__ import print_function # For python 2 copmatibili...
StarcoderdataPython
5012926
#!/usr/bin/python3 from argparse import ArgumentParser from os import getcwd from pathlib import Path from pprint import pprint from InquirerPy import inquirer from InquirerPy.base import Choice from .git import ( get_extra_gitconfig_file, gitconfig_parse_repotags, gitconfig_add, gitconfig_remove, ) fr...
StarcoderdataPython
9662719
<reponame>wesselb/matrix import lab as B from matrix import ( Constant, Dense, Diagonal, Kronecker, LowerTriangular, UpperTriangular, Zero, ) # noinspection PyUnresolvedReferences from ..util import ( AssertDenseWarning, approx, check_un_op, const1, dense1, diag1, ...
StarcoderdataPython
6693967
import configargparse import requests import logging import getpass from colorlog import ColoredFormatter parser = configargparse.ArgumentParser( description='Connect to a netExtender VPN', default_config_files=['/etc/nxbender', '~/.nxbender'], ) parser.add_argument('-c', '--conf', is_config_file=...
StarcoderdataPython
8066412
from setuptools import setup setup( name="Verify", description="Szyfrowanie hasła", version="v1.0", author="<NAME>", author_email="", licence="MIT", install_requires=["Click"], packages=['Verify'], entry_points={ 'console_scripts' : ['verify = Verify.main:main'] } )
StarcoderdataPython
128172
import requests from pytrello.decorators import as_json from pytrello.decorators import authorized @authorized @as_json def get(url, payload=None, **kwargs): return requests.get(url.format(**kwargs), params=payload) @authorized @as_json def post(url, payload=None, **kwargs): return requests.post(url.format(...
StarcoderdataPython