id
stringlengths
2
8
text
stringlengths
16
264k
dataset_id
stringclasses
1 value
18096
<reponame>Relintai/pandemonium_engine # MIT License # # Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation th...
StarcoderdataPython
117333
<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ """ import numpy as np from skimage import draw from scipy.ndimage import label, morphology import copy import time import skimage as sk import matplotlib as mpl import plotting mpl.rcParams['figure.dpi'] = 300 def pixellines_to_ordered_points(mat...
StarcoderdataPython
3403438
import numpy as np def load_spectrum(spectrum_path, lambda_min=100, lambda_max=1000, delimiter=','): """ Load a spectrum file. Parameters ---------- spectrum_path : string File path. lambda_min : scalar, optional Cut the data at this minimum wavelength in nm....
StarcoderdataPython
1651284
# coding=utf-8 # Copyright 2019 DeepMind Technologies Limited. # # 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 applic...
StarcoderdataPython
5103468
import re import pandas as pd import snscrape.modules.twitter as sntwitter maxTweets = 1000 tweets = [] keywords = ['TSLA', 'NVDA'] start = '2022-02-01' end = '2022-02-02' def clean_text(text): text = re.sub("@[A-Za-z0-9]+", '', text) text = re.sub("#[A-Za-z0-9_]+", '', text) text = re.sub("https?://S+...
StarcoderdataPython
6614353
<filename>backend/sensors/Sensor.py<gh_stars>1-10 from Bluetin_Echo import Echo class Sensor: def __init__(self, trigger_pin, echo_pin, angle): self._trigger_pin = trigger_pin self._echo_pin = echo_pin self._angle = angle self._sr04 = Echo(self._trigger_pin, self._echo_pin) def getDistance(self, samples =...
StarcoderdataPython
3497058
from datetime import datetime from functools import reduce from typing import List DESIRED_QUOTE_KEYS = [ "bid_price", "ask_price", "bid_size", "ask_size", "updated_at", "last_trade_price", "last_extended_hours_trade_price", ] def pluck(keys: List[str], dictionary: dict) -> dict: def...
StarcoderdataPython
8023591
<reponame>teodoramilcheva/softuni-software-engineering from project.motorcycle import Motorcycle class CrossMotorcycle(Motorcycle): pass
StarcoderdataPython
11366268
<filename>hackerearth/events/june_circuits/set-2/little_boruto_and_rail_ways/solution-2.py def main(): n, m = map(int, raw_input().split()) roads = map(lambda _ : map(int, raw_input().split()), range(0, m)) v = [0] * n for i, j in roads: if i != j: v[i - 1] = 1 v[j - 1] = 1 design_score = reduce(lambda...
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
9684657
# pylint: disable=invalid-name """ SAS generic computation and sld file readers """ from __future__ import print_function import os import sys import copy import logging from periodictable import formula from periodictable import nsf import numpy as np from . import _sld2i from .BaseComponent import BaseComponent l...
StarcoderdataPython
3461432
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns from .provider import AdRollProvider urlpatterns = default_urlpatterns(AdRollProvider)
StarcoderdataPython
127927
import json import requests import base64 from past.builtins import basestring from auth0_provider import Auth0Provider class AuthzAssociationProvider(Auth0Provider, object): """ """ def __init__(self, supported_resource_type, owner, owned, collection=None): super(AuthzAssociationProvider, self)...
StarcoderdataPython
313496
import logging # Log certificate warnings to 'warnings.log'. class MyFilter(object): def __init__(self, level): self.__level = level def filter(self, logRecord): return logRecord.levelno == self.__level def log_warnings(): handler = logging.FileHandler('warnings.log') logging.captur...
StarcoderdataPython
6688736
<reponame>Arun-Singh-Chauhan-09/Supply-demand-forecasting from order import ExploreOrder import matplotlib.pyplot as plt import seaborn as sns sns.set(color_codes=True) from utility.datafilepath import g_singletonDataFilePath from visualization import visualizeData import numpy as np import math class VisualizeTestDa...
StarcoderdataPython
202392
# 4.12 Paths with Sum # You are given a binary tree in which each node contains an integer value # which might be positive or negative. # Design an algorithm to count the number of paths that sum to a given value. # The path does not need to start or end at the root or a leaf, but it must go # downwards, trav...
StarcoderdataPython
3454388
import hdfsWikipediaVisualizador #hdfsWikipediaVisualizador.hdfsWikipediaLocal é um dic com as localizações do hdfs #da wikipedia num dictionary de elementos ID = {"latitude": latitudeID, "longitude" : longitudeID} import csvLinkedInVisualizador #csvLinkedInVisualizador.csvLinkedinLocais é um dic com as localizações ...
StarcoderdataPython
9744299
print("Analisador de triângulo.") r1 = float(input("Digite a medida da reta 1: ")) r2 = float(input("Digite a medida da reta 2: ")) r3 = float(input("Digite a medida da reta 3: ")) if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2: print("Essas retas podem formar um triângulo!") if r1 == r2 == r3: pri...
StarcoderdataPython
6626278
#!/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. import pytest try: import torch except ImportError: torch = None @pytest.mark.skipif(torch is None, reason="T...
StarcoderdataPython
1812171
<reponame>imamol/license_automation<filename>lib/github.py from __future__ import print_function from builtins import input import requests from requests.auth import HTTPBasicAuth import json import base64 import getpass import sys import github3 def _get_sha(username, password, url): r = requests.g...
StarcoderdataPython
6516620
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
StarcoderdataPython
3383760
<reponame>fishbigger/echookPi<filename>sendData.py """ ================================== BLUETOOTH DATA PACKETING FUNCTIONS ================================== * The two functions in this section handle packeting the data and sending it over USART to the bluetooth module. The two functions are * identically named s...
StarcoderdataPython
329609
#!/usr/bin/env python # # Copyright 2007 Google 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 # # Unless required by applicable law o...
StarcoderdataPython
11398515
<reponame>sopvop/maya-usd<filename>plugin/pxr/maya/lib/usdMaya/testenv/testUsdMayaGetVariantSetSelections.py #!/pxrpythonsubst # # Copyright 2016 Pixar # # 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 Li...
StarcoderdataPython
9688872
<reponame>sourav0220/ro-crate-py<filename>test/test_model.py # Copyright 2019-2020 The University of Manchester, UK # Copyright 2020 Vlaams Instituut voor Biotechnologie (VIB), BE # Copyright 2020 Barcelona Supercomputing Center (BSC), ES # Copyright 2020 Center for Advanced Studies, Research and Development in Sardini...
StarcoderdataPython
5103060
#!/bin/python from __future__ import absolute_import, division, unicode_literals import sys try: import requests except ImportError: requests = None try: import pycurl except ImportError: pycurl = None try: # Python 3 from urllib.parse import urlencode from urllib.request import Request,...
StarcoderdataPython
3210862
import os from django.db import models from django.contrib.auth.models import User from ckeditor_uploader.fields import RichTextUploadingField from applications.alumniprofile.models import Profile from applications.events_news.models import Event from applications.gallery.models import Album def upload_photo(instance...
StarcoderdataPython
3444815
<filename>year1/python/week3/q24_rot13.py ### This program uses ROT13 encryption used in the first century ### import string def substituteCharacter(uncryp): encryp_const = 13 ## One possible method to code this function is shown below but requires more lines ## alphabet = list(string.ascii_lowerca...
StarcoderdataPython
1635651
from thinsos.core import SOS
StarcoderdataPython
11323212
<gh_stars>10-100 from ..decorators import stere_performer from ..field import Field @stere_performer('null_action', consumes_arg=False) class Root(Field): """A simple wrapper over Field, it does not implement a performer method. Although Root has no specific behaviour, it can be useful when declaring a ro...
StarcoderdataPython
8164983
import cv2 as cv src = cv.imread("D:/Images/lena.jpg") cv.namedWindow("src", cv.WINDOW_AUTOSIZE) src = cv.cvtColor(src, cv.COLOR_BGR2GRAY) cv.imshow("src", src) # 只赋值sigmaX,默认sigmaY = sigmaX dst1 = cv.blur(src, (5, 5), anchor=(-1, -1), borderType=4) dst2 = cv.GaussianBlur(src, (5, 5), 15, borderType=4) dst3...
StarcoderdataPython
8176071
import logging log = logging.getLogger(__name__) try: from PyQt4 import QtCore as QtCore_ from PyQt4 import QtGui as QtGui_ from PyQt4.QtCore import pyqtSlot as Slot, pyqtSignal as Signal except ImportError, e: from PySide import QtCore as QtCore_ from PySide import QtGui as QtGui_ from PySide....
StarcoderdataPython
1892363
<reponame>AdrianaViabL/Curso-Python-udemy<filename>3 - python POO/113 - docstrings/uma_linha.py """documento de uma linha""" variavel = 'valor' def funcao(): return 2
StarcoderdataPython
11359990
<filename>udp/test.py #!/usr/bin/env python3 while True: try: user_input = input("username: ") if not user_input: raise ValueError('empty string') else: break except ValueError as e: print(e)
StarcoderdataPython
114400
<reponame>aleasims/Peach def Test(tester): from Ft.Lib.DbUtil import EscapeQuotes for i,out in [('hello','hello'), ("he'llo",r"he\'llo"), ("he'll'o",r"he\'ll\'o"), ("'hello'",r"\'hello\'"), ("'","\\'"), (r"hhh\\hhhh",r"h...
StarcoderdataPython
1852353
'''ALUMNA: <NAME> EJERCICIO 06: Merge k Sorted Lists''' # DESCRIPCION: SE RECIBE UN ARRAY DE K LISTAS VINCULADAS, CADA LISTA VINCULADA SE ORDENA EN ORDEN ASCENDENTE Y SE UNEN EN UNA SOLA LISTA. import queue def MergeList(lista): priority_queue = queue.PriorityQueue() # SE CREA LA COLA DE PRIORIDAD...
StarcoderdataPython
3220616
<gh_stars>10-100 from repldex.backend.typings import DatabaseEntry, DatabaseHistoryItem, PartialDatabaseEntry from typing import Any, Dict, List, Optional, Union from datetime import datetime import motor.motor_asyncio import uuid import os connection_uri = os.getenv('dburi') client = motor.motor_asyncio.AsyncIOMotor...
StarcoderdataPython
9640478
<reponame>moamenibrahim/nlp-project from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from UI.qrangeslider import QRangeSlider import main import viewer class mainWindow(QDialog): """This class will hold buttons and checkboxes to specify parameters as inputs to the program ...
StarcoderdataPython
5122982
from app.model.Base import selectDB, insertBD class Vehiculo(): @staticmethod def listaVehiculos(idPersona): data = selectDB("SELECT * FROM Vehiculo") return recorrerResultados(data) @staticmethod def createVehiculo(marca, idPersona, idTipo): query = "EXEC spCrearVehiculo @Mar...
StarcoderdataPython
12855686
<reponame>ShubhamAnandJain/MWP-CS229 from __future__ import absolute_import from __future__ import print_function from __future__ import division from mwptoolkit.module.Encoder import graph_based_encoder,rnn_encoder,transformer_encoder
StarcoderdataPython
1865395
# this module provide methods to search on various search engines and return parsed results # later we may add proxy pool to avoid search engine ban # we may also use boost method to jointly use search results from different search engines
StarcoderdataPython
8002914
<filename>main.py # utilities import sip, sys, os, re, webbrowser sip.setapi('QString', 2) from PyQt4 import QtGui, QtCore from functools import partial # GUI from raxmlOutputWindows import allTreesWindow, donutPlotWindow, scatterPlotWindow, pgtstWindow, robinsonFouldsWindow, heatMapWindow, bootstrapContractionWindow,...
StarcoderdataPython
3459738
import FuncoesDados # Terceira parte para exportar o resultado microdados = FuncoesDados.MicrodadosENEM("MicrodadosFiltradosComQuest.csv", colunas=None) microdados.exportar_resultado() # microdados.mostrar_resultado() # Opicional print("Concluído.")
StarcoderdataPython
396825
<gh_stars>0 #!/usr/bin/env python """The Planet aggregator.""" __authors__ = [ "<NAME> <<EMAIL>>", "<NAME> <<EMAIL>>" ] __license__ = "Python" from distutils.core import setup from planet import __version__ as planet_ver setup(name="planet", version=planet_ver, packages=["planet", "plan...
StarcoderdataPython
6455209
from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.urls import reverse, reverse_lazy from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, Redirec...
StarcoderdataPython
9771678
<reponame>UKHomeOffice/PythonFakerExtensions financial_institutions = { "Barclays": {"bank_code": "BARC"}, "Bank of Scotland": {"bank_code": "BOFS"}, "Halifax": {"bank_code": "HLFX"}, "HSBC": {"bank_code": "MIDL"}, "Natwest": {"bank_code": "NWBK"}, "Nationwide": {"bank_code": "NAIA"}, "Royal...
StarcoderdataPython
6644058
# ============LICENSE_START==================================================== # org.onap.dcaegen2 # ============================================================================= # Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved. # Copyright (c) 2020 Pantheon.tech. All rights reserved. # ======...
StarcoderdataPython
8059584
<reponame>bionicles/neuromax import tensorflow as tf from tools import log, pipe import nature L = tf.keras.layers def get_output(G, AI, id): node = G.node[id] log('get output for', node) if node["shape"] is "cylinder": return if node["output"] is not None: return node["output"] no...
StarcoderdataPython
4816780
import os HOME_DIR = os.path.expanduser("~") ROOT_DIR = os.path.join(HOME_DIR, "DAZ 3D", "Bridges", "Daz To Maya") EXPORT_DIR = os.path.join(ROOT_DIR, "Exports")
StarcoderdataPython
5164621
# -*- coding: utf-8 -*- import sys try: from setuptools import setup except ImportError: from distutils.core import setup sys.path.insert(0, '.') from python_lib import __version__, __doc__ setup( name="python_lib", version=__version__, description=__doc__, packages=["python_library"], pl...
StarcoderdataPython
1768749
import subprocess from datetime import datetime from email.mime.text import MIMEText from smtplib import SMTP_SSL from uuid import uuid4 from pymongo.collection import Collection def send_confirmation_email(col: Collection, email: str): # Generate a code confirmation_code = str(uuid4()) col.update_one({'e...
StarcoderdataPython
8174254
# -*- coding: utf-8; -*- import sys import tkinter from tkinter import ttk import glob import gui import data import os.path import time import urllib.parse def show(conf_dir): root = tkinter.Tk() def createCombbox(parent, title, valList, onSelected): frame = tkinter.LabelFrame(parent, bd=2, relief=...
StarcoderdataPython
98768
from .Pane import Pane # Since the other classes use Pane is must be first from .CluePane import CluePane from .MediaPane import MediaPane from .ChatPane import ChatPane from .AppPane import AppPane __all__ = ['CluePane', 'MediaPane', 'Pane', 'ChatPane', 'AppPane']
StarcoderdataPython
3580668
<filename>UDEMY-Learn Python Programming Masterclass/Section 4-Program Flow Control in Python/exercise5.py # Extracting capitals # Write a program to print out the capital letters in the string # # "Alright, but apart from the Sanitation, the Medicine, Education, Wine, Public Order, Irrigation, Roads, the Fresh-Water S...
StarcoderdataPython
5053505
<filename>bin/ADFRsuite/CCSBpckgs/geomutils/efitlib.py # This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.5 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2, 6, 0):...
StarcoderdataPython
11336028
"""Module for converting between NetworkX and RDFLib graphs""" from .rdf import RDFConverter from .nx import NXConverter
StarcoderdataPython
4888994
from __future__ import with_statement import py import pytest import sys import os import subprocess import inspect import execnet from execnet import gateway_base, gateway, gateway_io from execnet.gateway_base import Message, ChannelFactory, Popen2IO try: from StringIO import StringIO as BytesIO except: from ...
StarcoderdataPython
6469196
<gh_stars>1-10 import ast import _ast import re from lightdp.typing import * import z3 _cmpop_map = { ast.Eq: lambda x, y: x == y, ast.Not: lambda x: z3.Not(x), ast.Gt: lambda x, y: x > y, ast.Lt: lambda x, y: x < y, ast.LtE: lambda x, y: x <= y, ast.GtE: lambda x, y: x >= y } _binop_map = { ...
StarcoderdataPython
4922124
<gh_stars>0 from python_framework import Controller, ControllerMethod, HttpStatus @Controller(url='/actuator/health', tag='HealthCheck', description='HealthCheck controller') class ActuatorHealthController: @ControllerMethod() def get(self): return {'status' : 'UP'}, HttpStatus.OK @Controller(url='/'...
StarcoderdataPython
11395298
<filename>aoc2021/day_05.py """ This problem can be solved in many ways. The optimal one AFAIK is using Bentley–Ottmann algorithm (O((n + k)log(n))). Unfortunately, I'm unable to implement it (yet). """ from __future__ import annotations from typing import NamedTuple, Generator from collections import Count...
StarcoderdataPython
8031281
<reponame>duanguanhua/python_practice print("hello world") age = 18 print("age变量里的值是%d" % age) name = "东哥" print("名字是:%s" % name)
StarcoderdataPython
8125236
# Copyright (c) 2020. <NAME> import enum class Move(enum.Enum): """ Enumerations of Moves allowed for the Bloxorz Block in the game Allowed moves are Left, Right, Up, Down """ Left = 1 Right = 2 Up = 3 Down = 4
StarcoderdataPython
4975445
import random import _curses, curses s=curses.initscr() curses.curs_set(0) sh,sw=s.getmaxyx() w=curses.newin(sh,sw,0,0) w.keypad(1) w.timeout(100) snk_x=sw/4 snk_y=sh/2 snake=[ [snk_y,snk_x] [snk_y,snk_x-1] [snk_y,snk_x-2] ] food=[sh/2,sw/2] w.addch(food[0],food[1],curses.ACS_PI) key=cu...
StarcoderdataPython
198369
# Copyright (c) 2013 CEF Python, see the Authors file. # All rights reserved. Licensed under BSD 3-clause license. # Project website: https://github.com/cztomczak/cefpython # NOTE: Template variables like {{VERSION}} are replaced with actual # values when make_installer.py tool generates this package # ins...
StarcoderdataPython
5082021
def factorial(n): '''returns n!''' return 1 if n < 2 else n * factorial(n-1) print(factorial(12)) print(factorial.__doc__) print(type(factorial)) fact = factorial print(fact(12)) # 高阶函数,返回函数的函数 l = ['jfis','apple','cherry','raspberry','banana'] print(sorted(l, key=len)) def reverse(word): return w...
StarcoderdataPython
8098916
import tensorflow as tf import cv2 import mnist import numpy as np def pred(filename, train_dir): img = cv2.imread(filename, flags=cv2.IMREAD_GRAYSCALE) img = tf.cast(img, tf.float32) img = tf.reshape(img, [-1, 28, 28, 1]) logits, predict = mnist.inference(img, training=False) saver = tf.train.Sa...
StarcoderdataPython
1884446
from pathlib import Path import pandas as pd from data_pipeline.etl.base import ExtractTransformLoad from data_pipeline.score import field_names from data_pipeline.utils import get_module_logger, unzip_file_from_url logger = get_module_logger(__name__) class EPARiskScreeningEnvironmentalIndicatorsETL(ExtractTransfo...
StarcoderdataPython
12812043
#-------------------------------------------------------------------------------------------------------------------- # Example python script that runs a few functional tests on NVMe drives. Goal is to demonstrate how to use nvmecmd # and fio to define custom NVMe tests. This is an example only and is not a comprehe...
StarcoderdataPython
4966145
<filename>src/commcare_cloud/environment/schemas/meta.py import jsonobject class MetaConfig(jsonobject.JsonObject): _allow_dynamic_properties = False deploy_env = jsonobject.StringProperty(required=True) env_monitoring_id = jsonobject.StringProperty(required=True) users = jsonobject.ListProperty(unico...
StarcoderdataPython
4843650
import peewee as pw from datetime import datetime from playhouse.shortcuts import model_to_dict from src.db import db class BaseModel(pw.Model): created_at = pw.DateTimeField(default=datetime.utcnow) updated_at = pw.DateTimeField(default=datetime.utcnow) def to_dict(self): return model_to_dict(s...
StarcoderdataPython
3317104
import numpy as np import cv2 from math import ceil # a very basic implementation of contrasting # takes every pixel and multiplies it with a fixed number def app_cont(image, contrast): h, w = image.shape new_image = np.zeros((h, w), dtype=np.uint8) for i in range(h): for j in range(w): ...
StarcoderdataPython
3391436
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ FreeFrom Categories Python module Version 1.1.1 """ # Import dependencies from flask import ( Blueprint, flash, render_template, redirect, request, url_for) from bson.objectid import ObjectId from forms import CategoryForm # Import PyMongo database inst...
StarcoderdataPython
8154032
import json import os, ctypes import re from tkinter import ttk from tkinter import messagebox as msg from tkinter import * import psutil import subprocess from urllib.request import urlopen class Application: def __init__(self, master, DNS: dict, connections: list): self.dns = DNS self.master = ma...
StarcoderdataPython
9618304
<gh_stars>0 def count(): import url while True: print(url.url)
StarcoderdataPython
179112
from __future__ import absolute_import from __future__ import division from __future__ import print_function from atvgnet import *
StarcoderdataPython
249012
<filename>threatmatrix/processing.py<gh_stars>0 import csv import sqlalchemy import folium import pandas as pd import cgi import re from pathlib import Path from bokeh.models.widgets import RangeSlider, Button, DataTable, \ TableColumn, NumberFormatter from bokeh.models import ColumnDataSource, Whisker from boke...
StarcoderdataPython
11215533
''' Created on Mar 31, 2015 @author: <NAME> <<EMAIL>> ''' from __future__ import division import numpy as np from scipy import optimize from .lib_bin_base import LibraryBinaryBase LN2 = np.log(2) class LibraryBinaryUniform(LibraryBinaryBase): """ represents a single receptor library with random entries. Th...
StarcoderdataPython
1895094
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
StarcoderdataPython
1742787
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- __all__ = ["api"] import flask import feedfinder2 from functools import wraps from flask.ext.login import current_user from .database import db from .models import User, Feed api = flask.Blueprint("api", __name__) def _get_user(): token = flask.request...
StarcoderdataPython
6431547
#!/usr/local/bin/python # -*- coding: utf-8 -*- import nlpregex.abs_graph.double_link import nlpregex.abs_graph.node import nlpregex.abs_graph.edge import nlpregex.abs_graph.graph import nlpregex.regular_language.sse_forrest # @brief represents one symbolic equation that consists of LHS = RHS. # LHS is a vari...
StarcoderdataPython
5101573
<reponame>medianetlab/katana-slice_manager<filename>katana-nbi/katana/api/function.py # -*- coding: utf-8 -*- import logging from logging import handlers import time import uuid from bson.json_util import dumps from flask import request from flask_classful import FlaskView import pymongo from katana.shared_utils.mong...
StarcoderdataPython
5148037
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation. 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...
StarcoderdataPython
9650994
from django.conf.urls import url from .views import (OrderCreateView,single_order,SingleOrder, generate_PDF,ReportsView,AdminReportsView) urlpatterns =[ url(r'^create_order/$',OrderCreateView.as_view(),name='create_order'), url(r'^single_order/(?P<order_id>[0-9]+)/$',SingleOrder.as_view(),name='single_...
StarcoderdataPython
1963602
from django.shortcuts import render, redirect from django.views.generic import TemplateView class IndexView(TemplateView): """Index view.""" template_name = "tosti/index.html" def get(self, request, **kwargs): """ GET request for IndexView. :param request: the request :p...
StarcoderdataPython
6513060
<reponame>mhwdvs/MITSBot<gh_stars>0 from . import ozbargain
StarcoderdataPython
293982
<filename>src/visualization/recall.py<gh_stars>1-10 import streamlit as st def recall_app(): st.title("Patient notes collection")
StarcoderdataPython
195249
import asyncio import itertools import time from .chatgetter import ChatGetter from ... import helpers, utils, errors from ...events.common import EventCommon # Sometimes the edits arrive very fast (within the same second). # In that case we add a small delta so that the age is older, for # comparision purposes. This...
StarcoderdataPython
11268145
<gh_stars>0 """Example DAG demonstrating the usage of the BashOperator.""" from datetime import timedelta import airflow from airflow.models import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.dummy_operator import DummyOperator args = { "owner": "Airflow", "start_date"...
StarcoderdataPython
5026289
<filename>tests/extmod/uctypes_le_addressof_field.py<gh_stars>10-100 try: import uctypes except ImportError: print("SKIP") raise SystemExit desc = { "f0": uctypes.UINT8 | 0, "f1": uctypes.UINT8 | 5, "f2": uctypes.UINT8 | 2, "f3": (uctypes.PTR | 8, uctypes.UINT8), "arr": (uctypes.ARRAY |...
StarcoderdataPython
8065812
<filename>iotsim/behaviors.py<gh_stars>0 from .core import Behavior from itertools import repeat, count class FlatlineBehavior(Behavior): def __init__(self, name, level=None): super().__init__(name, level=level) def activate(self, assembly_context=None): self.update_parameters(assembly_contex...
StarcoderdataPython
1659363
<reponame>jcfr/SlicerPipelines import abc import collections from os import stat PipelineProgress = collections.namedtuple("PipelineProgress", "progress currentPipelinePieceName currentPipelinePieceNumber numberOfPieces") class PipelineInterface(abc.ABC): @staticmethod @abc.abstractmethod def GetName(): p...
StarcoderdataPython
8042700
<gh_stars>0 import mock import tempfile import os from zocalo_dls.wrapper.generic import ( ProcessRegisterWrapper, TargetProcessRegisterWrapper, ) @mock.patch("workflows.recipe.RecipeWrapper") @mock.patch("procrunner.run") def test_process_wrapper(mock_runner, mock_wrapper): mock_runner.return_value = {...
StarcoderdataPython
9629888
<gh_stars>0 #!/usr/bin/nv python3 # ###################### # Covid-19 Stats App # ###################### # # BY: Chadless1 # # Description: Pulls data from mytimes github and uses dash to display charts and graphs # analyzing the data by the US and each individual state # import pandas as pd import numpy as np import ...
StarcoderdataPython
11305933
<reponame>miguelbravo7/frontur_excel_addin from setuptools import setup, find_namespace_packages with open("README.md", 'r') as f: long_description = f.read() with open("requirements.txt", 'r') as f: requirements = f.read().splitlines() setup( name="fronTur_excel_addin", author="<NAME>", author_e...
StarcoderdataPython
8128071
<reponame>mtravis/UK-Polling-Stations from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = "E07000135" addresses_name = "local.2019-05-02/Version 1/Democracy_Club__02May2019OW.CSV" stations_name = "local.2019-05-...
StarcoderdataPython
4956223
from lbclassifier import LexiconBasedClassifier # Lexicon lexicon = { "positive": [ { "term": "excellent", "weight": 1.0 }, { "term": "good", "weight": 0.7 } ], "negative": [ { "term": "horrible", "weight": 1.0 }, { "term": "bad", "weight": 0.8 } ], } # Documents to classify raw_documents = [...
StarcoderdataPython
3314349
<filename>ALDS/ALDS1_9_C_using_heapq.py<gh_stars>1-10 import sys import io sys.stdin = open("ALDS1_9_C_in4.txt", 'r') #tmp = input() # copy the below part and paste to the submission form. # ---------function------------ import sys import heapq nodes = [] outputs = [None] * 2000000 _num_outputs = 0 ...
StarcoderdataPython
9742087
<gh_stars>0 from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf import tensorflow_probability as tfp import datetime import os, sys from argparse import ArgumentParser # Debug module # from tensorflow.python import debug as tf_debug import numpy as np import warn...
StarcoderdataPython
3500333
import numpy as np def get_B_df_distorted(df, v="0", **kwargs): if v == "0": return dist0(df, **kwargs) def dist0(df, **kwargs): df_ = df.copy() if 'Bzf' in kwargs.keys(): Bzf = kwargs['Bzf'] else: Bzf = 0. if 'Bz0' in kwargs.keys(): Bz0 = kwargs['Bz0'] else: ...
StarcoderdataPython
8010258
#!/usr/bin/env python3 from pwn import * context(arch = 'amd64', os = 'linux') def xgcd(b, n): # take positive integers a, b as input, and return a triple (g, x, y), such that ax + by = g = gcd(a, b). x0, x1, y0, y1 = 1, 0, 0, 1 while n != 0: q, b, n = b // n, n, b % n x0, x1 = x1, x0 - q * x1 ...
StarcoderdataPython