id
stringlengths
1
7
text
stringlengths
6
1.03M
dataset_id
stringclasses
1 value
85749
# -*- coding: utf-8 -*- import os import subprocess class execlib: @staticmethod def get_stdout(cmdline): """ @return A byte string, so maybe need to decode with .decode('cp932')""" return subprocess.check_output(cmdline, shell=True) @staticmethod def execute(cmdline): """ @re...
StarcoderdataPython
1786019
from website_downloader.services.files import FilesService from website_downloader.services.utils import is_google_tag_manager class ScriptsService(FilesService): def extract_elements_from_page(self): raw_links = self.page.find_all('script') for raw in raw_links: src = raw.attrs.get('...
StarcoderdataPython
11928
# -*- coding: future_fstrings -*- import codecs import pdb import string # NOTE https://stackoverflow.com/questions/38777818/how-do-i-properly-create-custom-text-codecs # prepare map from numbers to letters _encode_table = {str(number): bytes(letter) for number, letter in enumerate(string.ascii_lowercase)} # prepar...
StarcoderdataPython
3396102
<filename>fiber.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Fiber Class ----------- To be used in conjuction with IFU reduction code, Panacea """ from __future__ import (division, print_function, absolute_import, unicode_literals) import numpy as np import cPickle as pickle import o...
StarcoderdataPython
3357004
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 31 09:28:17 2021 @author: qichen """ from aiida import load_profile profile = load_profile() from aiida.common import LinkType from aiida.orm.utils.links import LinkPair from aiida.tools.visualization import Graph, pstate_node_styles graph = Graph(...
StarcoderdataPython
35482
import matplotlib import matplotlib.pyplot as plt import numpy as np import csv import seaborn as sns import itertools import pandas as pd import scipy from scipy.signal import savgol_filter from scipy.signal import find_peaks_cwt from scipy.signal import boxcar sns.set(font_scale=1.2) sns.set_style("white") colors = ...
StarcoderdataPython
1630211
#!/usr/bin/env python # Note that this should be used with original GALFIT. from glob import glob from astropy.io import fits as pyfits import os, sys, getopt """make_images.py - Create images for galfitm spiralsim test As well as creating singe-band images from the model feedmes, this routine produces mul...
StarcoderdataPython
3246922
from __future__ import print_function import random import math import numpy as np import torch import torchnet as tnt class FewShotDataloader: def __init__( self, dataset, nKnovel=5, nKbase=-1, nExemplars=1, nTestNovel=15*5, nTestBase=15*5, batch_...
StarcoderdataPython
3325921
<reponame>linux-machine/linuxmachinebeta from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.permissions import AllowAny from linuxmachinebeta.view.api.serializers import ServiceViewSerializer from linuxmachinebeta.utils.helpers import get_user_ip class ServiceVi...
StarcoderdataPython
1796067
<reponame>pbhatia243/DeepCRF # A few utility functions import itertools import numpy as np ############################################### # Generally useful functions # ############################################### # useful with reshape def linearize_indices(indices, dims): res = [] remain...
StarcoderdataPython
3203455
<filename>turtlepoly.py """ File: <turtlestar.py> Copyright (c) 2016 <<NAME>> License MIT <This code produces a polygon with any number of sides given that it is a natural number.> """ import turtle bob = turtle.Pen() num_sides_inp = raw_input("Enter number of sides: ") num_sides = int(num_sides_inp) side_len_inp...
StarcoderdataPython
1650817
from os.path import isfile from .formats.zip_file import ZIPFile from .formats.compressed_file import TempDirectory class Decompressor(object): def __init__(self, f): self.f = f def get_fmt(self): magic = self.f.read(8) self.f.seek(0) for fmt in [ ZIPFile ]: if fmt...
StarcoderdataPython
1629293
from __future__ import absolute_import from celery import Celery from django.conf import settings app = Celery('webalyzer') app.config_from_object('django.conf:settings') app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
StarcoderdataPython
1770560
# ------------------ # Only for running this script here import logging import sys from os.path import dirname sys.path.insert(1, f"{dirname(__file__)}/../../..") logging.basicConfig(level=logging.DEBUG) # ------------------ # --------------------- # Flask App for Slack OAuth flow # --------------------- import os i...
StarcoderdataPython
1795445
<reponame>annahs/atmos_research import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np import os import sys from pprint import pprint from datetime import datetime from datetime import timedelta import pickle import copy from mpl_toolkits.basemap import Basemap import mysql.connector tim...
StarcoderdataPython
3298977
# coding: utf-8 """ Xero Finance API The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital. # noqa: E501 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ ...
StarcoderdataPython
1794413
from __future__ import annotations import abc import inspect from typing import TYPE_CHECKING from PySide2.QtCore import QObject, Signal from bsmu.vision.core.data import Data from bsmu.vision.core.plugins.processor.base import ProcessorPlugin if TYPE_CHECKING: from typing import Type from pathlib import Pa...
StarcoderdataPython
1783891
<gh_stars>0 class BearPair: def bigDistance(self, s): i = 0 j = len(s) - 1 num = 0 first = s[i] second = s[j] while j > 0 and s[j] == first: j -= 1 first_result = abs(i - j) j = len(s) - 1 while i < len(s) - 1 and s[i] ...
StarcoderdataPython
3206005
<reponame>tartufotaruffetti/Catalog<filename>database_setup.py import os import sys import datetime from sqlalchemy import Column, ForeignKey, Integer from sqlalchemy import String, DateTime, Text, LargeBinary from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchem...
StarcoderdataPython
1676463
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. All Rights Reserved. # # 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 # # U...
StarcoderdataPython
3284649
# coding=utf-8 # Copyright 2020 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/licenses/LICENSE-2.0 # # Unless required by applicab...
StarcoderdataPython
3381662
import plotly as py import plotly.graph_objs as go # ----------pre def pyplt = py.offline.plot # ----------code trace0 = go.Scatter( x=[1, 2, 3, 4], y=[10, 11, 12, 13], text=['A</br>size: 40</br>default', 'B</br>size: 60</br>default', 'C</br>size: 80</br>default', 'D</br>size: 100</br>default'], mode=...
StarcoderdataPython
192965
""" sphinx.util.typing ~~~~~~~~~~~~~~~~~~ The composite types for Sphinx. :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import typing from struct import Struct from types import TracebackType from typing import Any, Callabl...
StarcoderdataPython
185345
import kivy kivy.require('2.0.0') from kivy.app import App from kivy.uix.screenmanager import ScreenManager, Screen from kivy.uix.gridlayout import GridLayout # Configuration files # import logging import etc.config as conf class PiDioGrid(Screen): def Radio(self): print('RadioScreen') ...
StarcoderdataPython
1726788
__author__='thiagocastroferreira' """ Author: <NAME> Date: 28/02/2019 Description: This script aims to generate the referring expressions. ARGS: [1] Path to the file with the Lexicalization step output [2] Path to the file with the Discourse Ordering step output [3] Path to the file wh...
StarcoderdataPython
3311406
""" A hodgepodge of utilities, most of which concern working with basic types. """ import logging logger = logging.getLogger(__name__) import itertools import os import shutil import pbio.misc.shell_utils as shell_utils def raise_deprecation_warning(function, new_module, final_version=None, old_module="mis...
StarcoderdataPython
3351041
<reponame>swarmee/swagger-4-es update_document_examples = { "update_document_new_field": { "summary": "Add a field to a document", "description": "Add one additional field to a elasticsearch document", "value": { "doc": { "newField": "newFieldValue" } ...
StarcoderdataPython
3215764
"""Remove points and cells from a mesh which are closest to a specified point.""" from vedo import * pu = Mesh(dataurl+'apple.ply').c('lightgreen').bc('tomato').lw(0.1) pt = [1, 0.5, 1] ids = pu.closestPoint(pt, N=200, returnPointId=True) pu.deletePoints(ids, renamePoints=1) show(Point(pt), pu, __doc__, axes=1).clo...
StarcoderdataPython
1715414
# -*- mode: python; coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*- # # $Id$ """Toolbox for images from the Cornell SLAC Pixel Array Detector (CSpad). XXX Better named cspad_common? XXX Read out detector temperature (see Hart et al., 2012)? """ from __future__ import absolute_import, division, print_funct...
StarcoderdataPython
119759
import os import urllib.parse from pelican import signals, contents # Generate an XML sitemap for the blog # The XML sitemap is NOT manually sent to Google but it is publicaly # available # The output filename FILENAME = 'sitemap.xml' # Table for change frequencies # These are default values that can be overriden i...
StarcoderdataPython
3223852
<reponame>danaraujocr/trendfitter<gh_stars>1-10 from trendfitter.models.DiPLS import DiPLS from trendfitter.models import PCA, PLS, SMB_PLS, MB_PCA, MB_PLS, MLSMB_PLS import pandas as pd from numpy import sqrt, mean import numpy as np from sklearn.model_selection import KFold, TimeSeriesSplit """ #pca_data = pd.read_c...
StarcoderdataPython
3367965
<reponame>mateusguida/ExerciciosPython<gh_stars>0 import os os.system("cls") #limpa janela terminal antes da execução numero = [[], []] for i in range(0,7): num = int(input("Digite um numero: ")) if num % 2 == 0: numero[0].append(num) else: numero[1].append(num) print('-=' * 30) numero[0...
StarcoderdataPython
3279293
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.fsl.preprocess import ApplyXfm def test_ApplyXfm_inputs(): input_map = dict(angle_rep=dict(argstr='-anglerep %s', ), apply_isoxfm=dict(argstr='-applyisoxfm %f', xor=['apply_xfm'], ),...
StarcoderdataPython
1726994
<gh_stars>0 # DAY 11 from typing import Dict, Tuple def read_input(): with open("./input.txt", "r", encoding="utf-8") as f: return parse_input(f.read()) def parse_input(input_str: str): ret = {} for i, line in enumerate(input_str.splitlines(keepends=False)): for j, char in enumerate(line...
StarcoderdataPython
86843
a,b,c=map(int,input().split()) x,d=0,0 while x<c: d+=1 x+=a if d%7==0: x+=b print(d)
StarcoderdataPython
1786363
import logging import pytest from mergify_engine import logs @pytest.fixture() def logger_checker(request, caplog): # daiquiri removes all handlers during setup, as we want to sexy output and the pytest # capability at the same, we must add back the pytest handler logs.setup_logging() logging.getLog...
StarcoderdataPython
4824485
<reponame>allenalvin333/Hackerrank_Prep<filename>3M/W5/2.py<gh_stars>1-10 # https://www.hackerrank.com/challenges/three-month-preparation-kit-strong-password/problem #!/bin/python3 import math import os import random import re import sys # # Complete the 'minimumNumber' function below. # # The function is expected t...
StarcoderdataPython
129586
<gh_stars>1-10 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Handling confounds. .. testsetup:: >>> import os >>> import pandas as pd """ import os import re import shutil import numpy as np import pandas as pd from nipype import log...
StarcoderdataPython
3231144
<reponame>marlenebDC/pycon import json class GraphQLClient: def __init__(self, client): self._client = client def query(self, query, op_name=None, variables=None, headers=None): """ Args: query (string) - GraphQL query to run op_name (string) - If the query is ...
StarcoderdataPython
3395097
<filename>iliasCorrector/utils.py from iliasCorrector import app, db from iliasCorrector.models import Exercise, Submission, File from flask import g from sqlalchemy import func import os import statistics def import_grades(exercise, points): if os.path.isfile(points): with open(points) as f: ...
StarcoderdataPython
34354
from bottle import request, response, HTTPResponse import os, datetime, re import json as JSON import jwt class auth: def gettoken(mypass): secret = str(os.getenv('API_SCRT', '!@ws4RT4ws212@#%')) password = str(os.getenv('API_PASS', 'password')) if mypass == password: ...
StarcoderdataPython
4835276
# -*- coding: utf-8 -*- # Copyright 2011 Google Inc. All Rights Reserved. # # 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 require...
StarcoderdataPython
1631225
from flask import Flask, Blueprint from flask_restful import Api, Resource from app.api.v1.views import CreateParcels, AllOrders, SpecificOrder, UserLogin,UserSignup, CancelOrder, GetOneOrder v1 = Blueprint('v1', __name__, url_prefix='/api/v1') api = Api(v1) """register the blueprints""" api.add_resource(CreateParcel...
StarcoderdataPython
4830241
<reponame>limeonion/Python-Programming ''' url= https://www.hackerrank.com/challenges/python-tuples/problem?h_r=next-challenge&h_v=zen ''' n = int(input()) integer_list = map(int, input().split()) print(hash(tuple(integer_list)))
StarcoderdataPython
3345397
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals """An implementation of the session and presentation layers as used in the D...
StarcoderdataPython
3271234
<filename>back/__init__.py # pylint: disable=wildcard-import from back.models import * from back.predictors import * from back.readers import *
StarcoderdataPython
1612563
import config import requests from pixivpy3 import ByPassSniApi RECOMMENDED = 0 KONACHAN = 1 YANDERE = 2 DANBOORU = 3 PIXIV = 4 pixivApi = ByPassSniApi() pixivApi.require_appapi_hosts() def login(): if config.pixiv_login_mode == 0: pixivApi.auth(refresh_token=config.pixiv_refresh_token) else: ...
StarcoderdataPython
110883
<gh_stars>0 from typing import Final, List SELF_CLOSING_TAGS: Final[List[str]] = [ "area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr", ] HIGHLIGHT_LANGUAGES: Final[List[str]] = [ "1c", ...
StarcoderdataPython
121501
import azureml.dataprep as dprep import azureml.core import pandas as pd import logging import os import datetime import shutil from azureml.core import Workspace, Datastore, Dataset, Experiment, Run from sklearn.model_selection import train_test_split from azureml.core.compute import ComputeTarget, AmlCompute from az...
StarcoderdataPython
1619553
<reponame>artemvalieiev/project_course_work import pandas as pd from typing import List, Tuple from ..predictor.ctwin_after_plant_predictor import CTWinAfterPlantPredictor class TestMainPredictor: _TEST_FILE_PATH = "src/tests/test_examples.csv" _BASE_PATH = "./model/" _MODEL_NAME = 'model.ctb' def ...
StarcoderdataPython
77662
<filename>tests/py/test_state_chain.py # coding: utf8 from __future__ import absolute_import, division, print_function, unicode_literals from base64 import b64encode import json from pando.exceptions import MalformedBody, UnknownBodyType from pando.http.request import Request from pando.http.response import Response...
StarcoderdataPython
1629575
from flask_wtf import FlaskForm from wtforms import StringField, TextAreaField, SubmitField, SelectField from wtforms.validators import InputRequired class PitchForm(FlaskForm): title = StringField('pitch_title') text = TextAreaField('pitch_text') category = SelectField('pitch_type', choices=[( 't...
StarcoderdataPython
1684622
# -*- coding:utf-8 -*- # !/usr/bin/python ''' Created on 21.05.2012 @author: philkraf ''' from . import db # Import smtplib for the actual sending function import sys # Import the email modules we'll need from .tools.mail import EMail, send from datetime import datetime msgtemplate = """ Liebe/r %(you)s, bis %(due)...
StarcoderdataPython
1643925
<filename>Snake.py<gh_stars>1-10 # from Item import * from ItemExtensions import * from Fleet import * class Snake(Fleet): def __init__(self, game_handle, head_coordinates, speed=2, rotation_speed=6, length=4, separation=16): super().__init__(game_handle) self.speed = speed self.rotation_...
StarcoderdataPython
3266173
# Optional Parameters tutorial nr1 # def func(x=1): # return x ** 2 # def func(word, add=5, freq=1): # print(word*(freq+add)) # call = func("hello", 0) class Car(object): def __init__(self, make, model, year, condition="New", kms=0): self.make = make self.model = model self.year = ...
StarcoderdataPython
1779914
<reponame>ethankelly/PythonFundamentals #!/usr/bin/env python # coding: utf-8 # # 4: Lists Solutions # # 1. Reverse a given list, e.g. if you get the list `[10, 20, 30, 40, 50]` you should print `[50, 40, 30, 20, 10]`. # * There are two possible ways you might try this. The first is using the `reverse()` function...
StarcoderdataPython
4800155
from .criss_cross_attention import CrissCrossAttention from .switchable_norm import SwitchableNorm, SwitchableNorm1D, SwitchableNorm2D, SwitchableNorm3D, SwitchableNormND
StarcoderdataPython
4816687
from infosystem.common import subsystem from infosystem.subsystem.domain import manager, resource, controller, router subsystem = subsystem.Subsystem(resource=resource.Domain, controller=controller.Controller, manager=manager.Manager, ...
StarcoderdataPython
1608959
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
StarcoderdataPython
3202768
<reponame>annanda/jogo-othello-ia<filename>models/minimax_alfabeta.py # -*- coding: utf-8 -*- from models.move import Move class MiniMaxAlfaBeta(object): def __init__(self, max_depth): self.chosen_move = None self.max_depth = max_depth def mini_max_alfa_beta(self, board, depth, color, parent...
StarcoderdataPython
3378635
from .library import acquire_library try: import simplejson as json except ImportError: import json class Context(object): UNINITIALIZED = 0 INITIALIZED = 1 def __init__(self, ffi, library): self._context = None self.ffi = ffi self._library = library self.state = s...
StarcoderdataPython
1697665
<reponame>motorny/chip-seq-pipeline2 #!/usr/bin/env python # ENCODE DCC TSS enrich wrapper # Author: <NAME>, <NAME> (<EMAIL>) import matplotlib as mpl mpl.use('Agg') import pybedtools import numpy as np from matplotlib import mlab from matplotlib import pyplot as plt import sys import os import argparse from encode_l...
StarcoderdataPython
169827
<filename>data_analytics/tensorflow_/keras_tutorials/cat_dog.py<gh_stars>0 import numpy as np import matplotlib.pyplot as plt import cv2 import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D import pickle from...
StarcoderdataPython
4814200
class OkApiException(Exception): pass class ApiError(OkApiException): def __init__(self, message): self.message = message class OkUploadException(OkApiException): pass class UploadPhotoError(OkUploadException): def __init__(self, message): self.message = message class UploadVid...
StarcoderdataPython
3358107
<reponame>Don-Joel/MyDash<filename>weather/forms.py from django import forms from django.forms import ModelForm, TextInput from .models import City, Zipcode class CityForm(ModelForm): class Meta: model = City fields = ['name'] widgets = { 'name': TextInput(attrs={'class' : 'inpu...
StarcoderdataPython
1609268
import numpy from skimage.data import camera from dexp.processing.interpolation.warp import warp from dexp.utils.backends import Backend, CupyBackend, NumpyBackend from dexp.utils.timeit import timeit def demo_warp_2d_numpy(): try: with NumpyBackend(): _demo_warp_2d() except NotImplemente...
StarcoderdataPython
186735
import io import os import time from collections import Counter from tempfile import NamedTemporaryFile import cv2 import numpy as np import pyautogui from gtts import gTTS from mpg123 import Mpg123, Out123 def get_screen_image(): with NamedTemporaryFile() as f: pil_image = pyautogui.screenshot(imageFile...
StarcoderdataPython
1697816
#!/usr/bin/env python3 from build import ninja_common build = ninja_common.Build('control') build.install('auv-controld3', f='control/auv_controld3.py') build.install('auv-navigated', f='control/auv_navigated.py')
StarcoderdataPython
1658379
__version_info__ = (2,0,2) __version__ = '2.0.2' from discogs_client.client import Client from discogs_client.models import Artist, Release, Master, Label, User, \ Listing, Track, Price, Video
StarcoderdataPython
117588
class User: """ class that generates new instances of user """ user_list=[] def __init__(self,first_name,last_name,create_pw,confirm_pw): ''' __init__ method that helps us define properties for our objects. Args: first_name: New user first name. ...
StarcoderdataPython
1638401
# coding=utf-8 import cv2 import tools.feature_extract as ife def orb_img(img, features_count): orb = cv2.ORB_create(features_count) orb_key_points, orb_desc = orb.detectAndCompute(img, None) orb_signed_img = cv2.drawKeypoints(img, orb_key_points, None) return orb_key_points, orb_desc, orb_signed_i...
StarcoderdataPython
3274492
<gh_stars>0 # 8-16 def make_car( manufacturer, type, **additions): """ Build a car profile. :param manufacturer: :param type: :param additions: :return car: """ car = dict() car['manufacturer'] = manufacturer car['type'] = type for k, v in additions.it...
StarcoderdataPython
3317995
<filename>mal_news.py import urllib.request as urllib2 from bs4 import BeautifulSoup print("\n\t\t--- MAL NEWS ---\n\n\tAuthor: <NAME>.\n\tSee my projects on Github: github.com/mynameismaz") class ScrapeWebsite(): def __init__(self, url): self.url = urllib2.Request(url, headers={'User-Agent':...
StarcoderdataPython
1678631
"""Patch extraction for images.""" # Copyright 2019 CSIRO (Data61) # # 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
96600
# -*- coding: utf-8 -*- import os import re import shutil from queue import Queue from threading import Thread def load_features(file): with open(file, mode='r', encoding='utf-8') as fp: features_list = fp.readlines() return [feature.strip('\n') for feature in features_list] def valid_feature(q, f...
StarcoderdataPython
1622420
<filename>source/rpg_game/__init__.py from .main import rpg_game
StarcoderdataPython
1655267
<reponame>elizusha/hypertoc<filename>scripts/converter.py #!/usr/bin/env python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/li...
StarcoderdataPython
3353306
import plotly.express as px import plotly.graph_objects as go from plotly.subplots import make_subplots import folium def plt_bar_demo(df, anno, provincia): fig = px.bar( df[(df.ANNO == anno) & (df.PROVINCIA == provincia)], x="FASCIA_ETA", y="POPOLAZIONE", color="GENERE", t...
StarcoderdataPython
116274
<gh_stars>0 from typing import NamedTuple from coordinates import spaced_coordinate Coordinates = spaced_coordinate("Coordinates", "xy") Orientation = NamedTuple( "Orientation", [("rot_x", float), ("rot_y", float), ("rot_z", float)] ) ThreeDCoordinates = spaced_coordinate("ThreeDCoordinates", "xyz") Spherical ...
StarcoderdataPython
3258462
<filename>glb_reader.py # glb reader import json import numpy as np import matplotlib.pyplot as plt from matplotlib import animation from mpl_toolkits.mplot3d import Axes3D import mpl_toolkits.mplot3d as plt3d import bone def read_jsonglb(file_path): with open(file_path) as f: # Remove the binary data from the st...
StarcoderdataPython
159679
<gh_stars>0 from django.views import generic from .models import Author, Book class IndexView(generic.ListView): template_name = 'library/index.html' context_object_name = 'all_books' def get_queryset(self): return Book.objects.order_by('pub_date') class AuthorView(generic.DetailVie...
StarcoderdataPython
4829879
""" Algorithm to check Prime number [Language used] - Python Author: Phanatagama """ number = int(input('Input a Number: ')) # If given number is greater than 1 if number > 1: # Iterate from 2 to n / 2 for i in range(2, number): # If num is divisible by any number between #...
StarcoderdataPython
3260648
<filename>keycloak_admin_aio/_resources/roles/by_id/composites/composites.py from keycloak_admin_aio.types import RoleRepresentation from .... import KeycloakResource class RolesByIdComposites(KeycloakResource): """Get composites for a role by id. .. code:: python from keycloak_admin_aio import Key...
StarcoderdataPython
3255623
<reponame>blackapple1202/TensorflowCodeRepo<filename>04.Create_Images_to_Table/create_image_table.py import PIL from PIL import Image, ImageOps, ImageDraw import pandas as pd import shutil import os.path import random from pathlib import Path ############### CONFIGURE ######################## # Table Configure Var...
StarcoderdataPython
141282
import os from django.core.management.base import BaseCommand from django.contrib.auth.models import User from ...models import ( TranscriptPhrase, TranscriptPhraseVote, TranscriptPhraseCorrection, TranscriptPhraseCorrectionVote ) class Command(BaseCommand): help = '''Deletes all votes, corrections, and...
StarcoderdataPython
3250843
from dataclasses import dataclass import dacite from . import file_store @dataclass class GitHub: access_token: str @dataclass class Secrets: github: GitHub def load(path: str) -> Secrets: content = file_store.load(path) return normer(content) def normer(data: dict) -> Secrets: return dac...
StarcoderdataPython
1689122
def _patch_descriptor_backwards_relation(descriptor): # we need to patch backwards relation for nullable fields to override # related_manager_cls.remove and related_manager_cls.clear methods # since they are using update orm technique w/o having any signal # see django.db.models.fields.related.ForeignR...
StarcoderdataPython
3394167
""" this is my second py code for my second lecture """ #print('hello world') #this is a single line comment """ This is my second regional comment """ # this is my second line comment #print(type('123')) #print("Hello World".upper()) #print("Hello World".lower()) #print(" hello world ") #print(" ...
StarcoderdataPython
124039
<filename>predict_recognition.py import argparse import os import time import numpy as np import pyaudio import tensorflow from record_demo import get_voice import random from audio import read_mfcc from batcher import sample_from_mfcc from constants import SAMPLE_RATE, NUM_FRAMES from conv_models import DeepSpeakerMo...
StarcoderdataPython
3220135
from datetime import datetime, timezone import uuid import json import requests def main(): print("Velkommen til verdens enkleste meldingsklient.") print("Klienten kan avsluttes når som helst ved å holde inne CTRL + C.") while True: print() print("Skriv inn meldingen du ønsker å sende til ...
StarcoderdataPython
3208671
""" ------------------------------------------------------------------------------ @file parser.py @author <NAME> (<EMAIL>) @brief ... @version 0.1 @date 2020-08-26 @copyright Copyright (c) 2020 Distributed under the MIT software license, see the accompanying ...
StarcoderdataPython
3213628
# coding=utf8 """Resize Common functions for resizing dimensions to fit, to crop, etc """ __author__ = "<NAME>" __copyright__ = "OuroborosCoding" __version__ = "1.0.0" __email__ = "<EMAIL>" __created__ = "2018-11-11" def crop(w, h, bw, bh): """Crop Makes sure one side fits and crops the other Arguments: w (in...
StarcoderdataPython
1700067
<reponame>mksh/k93s """Main k93 CLI module.""" import contextlib import logging import tempfile import os import yaml import click import k93s import k93s.config import k93s.provision import k93s.vms import k93s.utils logger = logging.getLogger(__name__) @contextlib.contextmanager def _with_config(ctx): confi...
StarcoderdataPython
3274760
<filename>waitlist/migrations/0001_initial.py<gh_stars>10-100 # Generated by Django 2.0.1 on 2019-01-07 14:44 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations....
StarcoderdataPython
1642470
# -*- coding: utf-8 -*- """ Zenoss jobs_router """ from zenossapi.routers import ZenossRouter class JobsRouter(ZenossRouter): """ Class for interacting with the Zenoss device router """ def __init__(self, url, headers, ssl_verify): super(JobsRouter, self).__init__(url, headers, ssl_verify, ...
StarcoderdataPython
3274367
<filename>src/client.py import time import socket import sys from thread import * from getpass import getpass import os from thread import * from client_core import * ''' Create Socket ''' try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print 'Created socket for the client' except socket.error: p...
StarcoderdataPython
99842
<reponame>ustutz/dataquest<gh_stars>1-10 class Script: @staticmethod def main(): cities = ["Albuquerque", "Anaheim", "Anchorage", "Arlington", "Atlanta", "Aurora", "Austin", "Bakersfield", "Baltimore", "Boston", "Buffalo", "Charlotte-Mecklenburg", "Cincinnati", "Cleveland", "Colorado Springs", "<NAME>", "Dallas", ...
StarcoderdataPython
77210
import pathlib from typing import Dict from app_types import WordSeq from word import Word class Words: words: list[Word] def __init__(self, letter_groups: str) -> None: def find_paths(letters: str) -> Dict[str, str]: 'Build dictionary of valid letter-to-letter transitions' d...
StarcoderdataPython
4818125
import imp from unicodedata import name from django.shortcuts import render from django.http import HttpResponse from .models import Post, Universities import wikipediaapi # from .wikiAPI import get_summary # Todo: import needs to be fixed # Create your views here. def index(request): """render the main page""" ...
StarcoderdataPython
159013
<reponame>bidhata/EquationGroupLeaks # uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: __init__.py def GetDir(subdir=None): import dsz import os.path resDir = dsz.env.Get('_LPDIR_RESOUR...
StarcoderdataPython