id
stringlengths
2
8
text
stringlengths
16
264k
dataset_id
stringclasses
1 value
3512834
<gh_stars>0 n=int(input('Enter the no of fibonacci series : ')) l1=[0,1] a=0 b=1 for x in range(n-1): c=a+b a=b b=c l1.append(c) print(l1)
StarcoderdataPython
1716882
""" """ from harmoniccontext.harmonic_context import HarmonicContext from tonalmodel.pitch_range import PitchRange class PolicyContext(object): def __init__(self, harmonic_context, pitch_range): self._harmonic_context = harmonic_context self._pitch_range = pitch_range @property def harm...
StarcoderdataPython
1730903
import os import matplotlib matplotlib.use("agg") from matplotlib import pyplot as plt import seaborn as sns import datetime import pandas as pd import matplotlib.dates as mdates import common infile = snakemake.input[0] outfile = snakemake.output[0] df = pd.read_table(infile) df["time"] = pd.to_datetime(df["time"])...
StarcoderdataPython
6489720
<gh_stars>1-10 from turtle import * speed(11) shape("turtle") sides = 12 angle = 360 / sides for count in range(sides): forward(100) left(angle)
StarcoderdataPython
5062309
<filename>eenlp/docs/generate_docs_models.py import mdformat import pandas as pd import yaml from pyprojroot import here from eenlp.docs.languages import languages from eenlp.docs.model_types import cases, corpora, types columns = [ "name", "description", "type", "cased", "languages", "pre-tra...
StarcoderdataPython
1959106
import re from datetime import date import dateparser from dateutil.rrule import MONTHLY, rrule from scrapy import Request from gazette.items import Gazette from gazette.spiders.base import BaseGazetteSpider class CeSobralSpider(BaseGazetteSpider): name = "ce_sobral" TERRITORY_ID = "2312908" start_date ...
StarcoderdataPython
8147578
<gh_stars>1-10 from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver import Chrome from selenium.webdriver.chrome.options import Options from bs4 import BeautifulSoup as bs import pandas as pd import numpy as np import sys import pickle def pull_page(url): chrome_options = Options() ...
StarcoderdataPython
1789603
import os import xlsxwriter import time import pickle import random import numpy as np import matplotlib.pyplot as plt from classes.quiz import Quiz from classes.save import Save from classes.result import Overall_Results, Result from classes.answer import Picture_Answer, Text_Answer, Answer from classes.school import...
StarcoderdataPython
9704929
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
StarcoderdataPython
9717434
<filename>simulation_control/src/scripts/detect_object_server.py #!/usr/bin/env python import rospy import actionlib import simulation_control.msg '''Object detection for F651 Copyright (C) 2018, CPS2018 Challenge by <NAME>. All rights reserved. ''' from geometry_msgs.msg import PoseStamped, Point class detect_objec...
StarcoderdataPython
5156161
<filename>src/posts/views.py from django.shortcuts import render, get_object_or_404 from posts.models import Recipe # Create your views here. def index(request): recipes = Recipe.objects.all().order_by('-timestamp') context = { 'recipes': recipes } return render(request, 'posts/index.html', co...
StarcoderdataPython
6588225
#! /usr/bin/env python3 import pycurl import yaml import argparse import io from extractor import ExtractorFactory # We should ignore SIGPIPE when using pycurl.NOSIGNAL - see # the libcurl tutorial for more info. try: import signal signal.signal(signal.SIGPIPE, signal.SIG_IGN) except ImportError: pass p...
StarcoderdataPython
11201811
import numpy as np from petsc4py import PETSc from src.geo import * from src import stokes_flow as sf from src.support_class import * from src.StokesFlowMethod import * __all__ = ['createEcoli_ellipse', 'createEcoliComp_ellipse', 'createEcoli_2tails', 'createEcoliComp_tunnel', 'createEcoli_tunnel', 'create_...
StarcoderdataPython
6569922
from __future__ import division from __future__ import print_function from __future__ import absolute_import import tensorflow as tf import numpy as np import gpflow from dmbrl.misc.DotmapUtils import get_required_argument class TFGP: def __init__(self, params): """Initializes class instance. ...
StarcoderdataPython
9636920
import numpy as np import os.path def IPF(row_totals, col_totals, seed_values=None, random_fill=False): """ Take two inputs: row and column totals. The inputs must be NumPy Arrays whose sums are equal. Optional input: seed_values (CSV only). Option: random_fill. """ # Initial condit...
StarcoderdataPython
5143227
<gh_stars>1-10 """Kata url: https://www.codewars.com/kata/55cb632c1a5d7b3ad0000145.""" def hoop_count(n: int) -> str: return ( "Keep at it until you get it" if n < 10 else "Great, now move on to tricks" )
StarcoderdataPython
11361333
from discord.ext import commands from .permissions import connected_to_channel from .universal import execute_in_storage def attach_unrecognized(bot, storage): """Add commands to regulate unsorted players.""" @bot.group(pass_context=True) @commands.check_any(connected_to_channel(storage)) async def ...
StarcoderdataPython
4937405
import random import logging from pathlib import Path from cdeid.utils.resources import PACKAGE_NAME logger = logging.getLogger(PACKAGE_NAME) def load_data(data_file): data = open(data_file).readlines() return data def pass_bio_checking(lines): for i, line in enumerate(lines): if ('-DOCSTART-'...
StarcoderdataPython
111885
<gh_stars>0 from django.db import models from django.contrib.auth.models import User # Create your models here. class Profile(models.Model): image = models.ImageField(default = 'default.jpg',upload_to='images/') bio = models.CharField(max_length=150) email = models.EmailField() phone_number = models...
StarcoderdataPython
5052450
<gh_stars>100-1000 """ ################################################################################################## # Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved. # Filename : text_spotting_dataset.py # Abstract : Implementation of text spottin...
StarcoderdataPython
11352797
import os import click import shutil import slackviewer from jinja2 import \ Environment, \ PackageLoader, \ select_autoescape from slackviewer.archive import \ extract_archive, \ get_users, \ get_channels, \ compile_channels def envvar(name, default): """Create callable environment ...
StarcoderdataPython
6699026
<filename>test/generate_tokens/test_return.py from src.token.token import Token from test.util import add_token, wrap_with_main def test_return(): test_str = wrap_with_main("int a = 5;return a;") tokens = add_token(test_str) token = tokens[-1] assert isinstance(token, Token) assert token.eval({'a...
StarcoderdataPython
222127
<filename>web_assembly/_table.py from __future__ import annotations from typing import List, Union, Any from dataclasses import dataclass, field from utils import dbgprint, errprint from web_assembly import ConstValue, Type @dataclass class FunRef: __fidx: int = field(repr=False) __original: Union[None, FunR...
StarcoderdataPython
6482439
"""CLI to run commands on MGS server.""" from sys import stderr import click from .utils import add_authorization @click.group() def run(): """Run actions on the server.""" pass @run.group() def middleware(): """Run middleware.""" pass @middleware.command(name='group') @add_authorization() @clic...
StarcoderdataPython
6704851
<filename>crafters/image/AlbumentationsCrafter/tests/test_albumentationscrafter.py<gh_stars>0 __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" import cv2 import numpy as np import pytest from jina.executors import BaseExecutor from jina.executors.metas import get_de...
StarcoderdataPython
6555086
from toee import * import _include from co8Util import size from co8Util.PersistentData import * from co8Util.ObjHandling import * RM_KEY = "Sp404_RighteousMight_Activelist" def OnBeginSpellCast( spell ): print "Righteous Might OnBeginSpellCast" print "spell.target_list=", spell.target_list p...
StarcoderdataPython
3571493
<filename>assets/code/create_casing_connections_graph.py import numpy as np import networkx as nx import import_from_tenaris_catalogue # our code from part 1 class Counter: def __init__(self, start=0): """ A simple counter class for storing a number that you want to increment by one. ...
StarcoderdataPython
3200256
import json import re from openstackinabox.services.cinder.v1 import base class CinderV1Volumes(base.CinderV1ServiceBase): # Note: OpenStackInABox's Keystone Service doesn't have support # right now for inserting the tenant-id into the URL when # generating the service catalog. So the service URL he...
StarcoderdataPython
1957652
<gh_stars>10-100 """Main conftest""" import pytest from asyncio import get_event_loop_policy from pydantic_odm.db import MongoDBManager pytestmark = pytest.mark.asyncio DATABASE_SETTING = {"default": {"NAME": "test_mongo", "PORT": 37017}} @pytest.yield_fixture(scope="session") def event_loop(): loop = get_eve...
StarcoderdataPython
186528
from ij import IJ from ij.plugin.frame import RoiManager from ij.gui import Roi from ij.gui import Overlay from ij import ImagePlus from ij.plugin import ChannelSplitter from ij import measure from ij.plugin.filter import Analyzer from ij.measure import ResultsTable from ij import WindowManager from java.io import File...
StarcoderdataPython
1676878
from __future__ import print_function, division from pyscf.nao.m_libnao import libnao from ctypes import POINTER, c_int64, byref libnao.init_dens_libnao.argtypes = ( POINTER(c_int64), ) # info def init_dens_libnao(): """ Initilize the auxiliary for computing the density on libnao site """ info = c_int64(-999) ...
StarcoderdataPython
6606181
<reponame>jfnavarro/st_ts<filename>scripts/tag_clusters_to_matrix.py<gh_stars>1-10 #! /usr/bin/env python """ Scripts that computes tag clusters counts (TTs) for ST data. It takes the file generated with compute_st_tts.py and compute a matrix of counts by doing intersection of the TTs with the original ST BED file ge...
StarcoderdataPython
11352613
import shelve import pickle import os import sharedFunctions import info class PersistentData: """ """ def __init__(self, inputData=None): """ """ self.inputData = inputData self.dbPath = sharedFunctions.getDbRepoDir() self.activeShelve = None self.data = ...
StarcoderdataPython
9686818
### Item Serializer ### from django.forms import widgets from django.core.urlresolvers import reverse from rest_framework import serializers from item.models import Item, ItemBaseParam class ItemParamSerializer(serializers.ModelSerializer): """ Used to serialize ItemParamDirectory objects. """ name = serial...
StarcoderdataPython
9600784
# -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # landbouwschade_QgistoArcMap.py # Created on: 2018-08-27 10:11:14.00000 # (generated by ArcGIS/ModelBuilder) # Usage: landbouwschade_QgistoArcMap <LBS_tussenstap> <landbouwschade2018> # Description: # -----...
StarcoderdataPython
126034
<filename>accounts/urls.py from django.conf.urls import url from django.contrib.auth import views as auth_views from django.views.generic.edit import CreateView from .forms import CustomUserCreationForm from .views import ( Registration, Profile ) urlpatterns = [ url( r'^login/$', auth_vi...
StarcoderdataPython
5150339
# __init__.py from .withings import Withings
StarcoderdataPython
11361936
<gh_stars>0 import os HOME = os.getenv('HOME') MUSIC_FOLDER = 'Music/' UPLOADS_FOLDER = os.path.join(HOME, MUSIC_FOLDER) MAX_UPLOAD_SIZE = 7e+6
StarcoderdataPython
1811374
<reponame>monosloth/console<filename>app/provider/command.py import yaml from monosloth.provider import AbstractProvider from app.singleton import Parser class CommandProvider(AbstractProvider): def register(self): """Register all commands with an argument parser. """ parser = Parser() ...
StarcoderdataPython
1632559
#!/usr/bin/python3 # imports {{{ import logging import threading import time import datetime import sys import tty, termios import random import argparse import atexit # }}} ################## Global stuff ################## {{{ x0 = 0 y0 = 0 sec = 0 sec_inc = 1 lock=threading.Lock() # Set up unbuffered read fr...
StarcoderdataPython
3244152
from .create_admin_user import ( create_admin_user )
StarcoderdataPython
5046876
import math import numpy as np class Partitioner: """2-dimensional domain decomposition of a 3-dimensional computational grid among MPI ranks on a communicator.""" def __init__(self, comm, domain, num_halo, periodic = (True, True)): assert len(domain) == 3, \ "Must specify ...
StarcoderdataPython
5159367
<reponame>joscelino/Python_Colletions from collections import namedtuple naipes = 'P C O E'.split() valores = list(range(2, 11)) + 'A J Q K'.split() carta = namedtuple('Carta', 'naipe valor') baralho = [carta(naipe, valor) for naipe in naipes for valor in valores]
StarcoderdataPython
3581681
<gh_stars>0 #!/usr/bin/env python3 # 上の行はこのファイルが Python 3 インタプリタのありかを指定しています. # この指定に加え,Linux/Mac でこのファイルに実行属性を与える(`chmod a+x simple.py`)と単に `./simple.py ...` のように起動できるようになります.Windows の場合は,`.py` 拡張子を処理するためのデフォルトアプリケーションを登録すれば,同じようなことができるかもしれません. # このプログラムは指定した UI ファイルを表示します. import sys from PyQt5 import QtWidgets, ...
StarcoderdataPython
1878039
<filename>lib/radiocorona/frontend/migrations/0001_initial.py # -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-23 20:31 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.db.models.manager import django.utils.timezone import mpt...
StarcoderdataPython
1757629
import setuptools setuptools.setup( name='interactive_widgets', version='0.0.1', packages=setuptools.find_packages(), entry_points={ 'console_scripts': [ 'interactive-widgets-backend = interactive_widgets.backend.main:main', 'interactive-widgets-monitor = interactive_wid...
StarcoderdataPython
5030331
<gh_stars>0 #from dynamodb import dynamo_functions #def test_scan_sheets(): # assert 1==1
StarcoderdataPython
3378793
<gh_stars>0 from nets.yolo3 import yolo_body from keras.layers import Input from yolo import YOLO from PIL import Image import numpy as np from datetime import datetime if __name__ == '__main__': yolo = YOLO() # x = 10 # photo = [] # with open('2007_test.txt') as f: # file = f.readlines() ...
StarcoderdataPython
6444409
# Copyright 2011 <NAME> (<EMAIL>) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
StarcoderdataPython
8194434
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import shutil import subprocess def build_docs(input_dir: str, output_dir: str): subprocess.call('python3 -m pip install --upgrade pip', shell=True, cwd=input_dir) subprocess.call('python3 -m pip install mkdocs', shell=True, cwd=input_dir) subproce...
StarcoderdataPython
5034404
# standard import time import socket # pyqt from PyQt5.QtCore import QObject, QRunnable, pyqtSignal class WorkerSignals(QObject): """Worker Signals""" progress = pyqtSignal(int) error = pyqtSignal(object) result = pyqtSignal(object) done = pyqtSignal() class Worker(QRunnable): """Worker""" ...
StarcoderdataPython
6507577
<gh_stars>0 # -*- coding: utf-8 -*- # -------------------------------------- # @Time : 2020/11/01 # @Author : <NAME> # @Email : <EMAIL> # @File : dataset.py # Description :preprocess data # -------------------------------------- import sys ros_path = '/opt/ros/kinetic/lib/python2.7/dist-packages' if ros_path ...
StarcoderdataPython
5183592
import networkx as nx from nose.tools import raises from regraph.attribute_sets import FiniteSet from regraph.rules import Rule from regraph.utils import assert_graph_eq, normalize_attrs from regraph.exceptions import RuleError import regraph.primitives as prim class TestRule(object): """Class for testing `regr...
StarcoderdataPython
4957976
import pytest import discretisedfield as df def test_instances(): p1 = (0, 0, 0) p2 = (100, 200, 300) cell = (1, 2, 3) region = df.Region(p1=p1, p2=p2) mesh = df.Mesh(region=region, cell=cell) field = df.Field(mesh, dim=3, value=(1, 2, 3)) assert df.dx(field) == 1 assert df.dy(field) ...
StarcoderdataPython
5008615
<filename>examples/framework_ideas/use_case.py # TODO #18. clean up obsolete ideas and out-of-date patterns from dataclasses import dataclass import typing as t from marshmallow import Schema from pca.exceptions import ProcessError, ValidationError from pca.utils.functools import reify from pca.utils.dependency_injec...
StarcoderdataPython
5049069
import websocket try: import thread except ImportError: import _thread as thread import time import json from datetime import datetime from pprint import pprint # Function that is executed when the socket received a message def on_message(ws, message): # Parsing the received JSON msg = json.loads(mess...
StarcoderdataPython
5034150
import os class Config: """Base configuration.""" ENV = None PATH = os.path.abspath(os.path.dirname(__file__)) ROOT = os.path.dirname(PATH) DEBUG = False THREADED = False # Constants GITHUB_SLUG = "jacebrowning/memegen" GITHUB_URL = "https://github.com/{}".format(GITHUB_SLUG) ...
StarcoderdataPython
7554
<gh_stars>0 from collections import Counter from datetime import datetime import os import requests from subprocess import Popen, PIPE from pathlib import Path import json from typing import Dict, Union, TYPE_CHECKING from kipoi_utils.external.torchvision.dataset_utils import download_url if TYPE_CHECKING: import...
StarcoderdataPython
104069
<reponame>zkscpqm/pyfilter<filename>pyfilter/src/filters/__init__.py<gh_stars>0 from pyfilter.src.filters.base_filter import _BaseFilter from pyfilter.src.filters.any_match_filter import _AnyMatchFilter from pyfilter.src.filters.all_match_filter import _AllMatchFilter from pyfilter.src.filters.regex_match_filter import...
StarcoderdataPython
6513700
<filename>src/logml/datasets/df/__init__.py<gh_stars>0 from .datasets_df import DatasetsDf from .df_explore import DfExplore
StarcoderdataPython
6631245
<filename>tetravolume.py """ Euler volume, modified by <NAME> http://www.grunch.net/synergetics/quadvols.html <NAME> (c) MIT License The tetravolume.py methods make_tet and make_tri assume that volume and area use R-edge cubes and triangles for XYZ units respectively, and D-edge tetrahedrons and triangles for IVM u...
StarcoderdataPython
3219035
<reponame>ltonetwork/lto-api.python<filename>tests/Transactions/SetScriptTest.py from LTO.Transactions.SetScript import SetScript from LTO.Accounts.AccountFactoryED25519 import AccountED25519 as AccountFactory from time import time from unittest import mock class TestSetScript: ACCOUNT_SEED = "df3dd6d884714288a3...
StarcoderdataPython
4863745
""" MODIFIED Bluegiga BGAPI/BGLib implementation ============================================ Bluegiga BGLib Python interface library 2013-05-04 by <NAME> <<EMAIL>> Updates should (hopefully) always be available at https://github.com/jrowberg/bglib Thanks to Masaaki Shibata for Python event handler code http://www.empt...
StarcoderdataPython
356491
from clickhouse_orm import migrations from ..test_migrations import * operations = [migrations.AlterTable(Model4_compressed), migrations.AlterTable(Model2LowCardinality)]
StarcoderdataPython
3392759
import argparse import requests import json import urllib3 from bs4 import BeautifulSoup from pathlib import Path from pathvalidate import sanitize_filename from tqdm import tqdm from urllib.parse import urljoin from exceptions import raise_if_redirect from parse_tululu_category import parse_category ...
StarcoderdataPython
3490212
<reponame>PsiLupan/calcprogress from os.path import basename from enum import IntEnum from re import search from dataclasses import dataclass from cw_map import Map SECTION_REGEX = r"^\s*.section\s+(?P<Name>.[a-zA-Z0-9_$]+)" class AsmSectionType(IntEnum): CODE = 0 DATA = 1 def get_section_type(name: str) -> ...
StarcoderdataPython
3220166
<filename>tools/XstreamDL_CLI/version.py<gh_stars>10-100 script_name = 'XstreamDL-CLI' __version__ = '1.4.1'
StarcoderdataPython
3261925
from lib.input import read_lines input = read_lines(5) replace = { 'F': 0, 'B': 1, 'L': 0, 'R': 1 } def seat_id(line): for char, to in replace.items(): line = line.replace(char, str(to)) return int(line, 2) def seat_ids(): return [ seat_id(line) for line in input ] def highest_seat_id(): re...
StarcoderdataPython
341894
"""dloud_ads - Abstract Data Structures commonly used in CS scenarios. Implemented by Data Loud Labs!""" __version__ = '0.0.2' __author__ = '<NAME> <<EMAIL>>' __all__ = []
StarcoderdataPython
3293586
from tir import Webapp import unittest from tir.technologies.apw_internal import ApwInternal import datetime import time DateSystem = datetime.datetime.today().strftime('%d/%m/%Y') DateVal = datetime.datetime(2120, 5, 17) """------------------------------------------------------------------- /*/{Protheus.doc} PLSA298T...
StarcoderdataPython
9683965
class Timer: _timers = {} @classmethod def run_deferred(cls,elapsed): timers = cls._timers.copy() for timer in timers.keys(): if timer.interval < elapsed: timer.run() timer.clear() def __init__(self,meth,interval): self._timers[self]...
StarcoderdataPython
9756367
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.functional import cached_property from django.views.generic import TemplateView from .models import Article from django_attachments.forms import ImageUploadForm from django_attachments.models import Library from django_at...
StarcoderdataPython
3443200
from reliability.Probability_plotting import Weibull_probability_plot from reliability.Distributions import Weibull_Distribution import matplotlib.pyplot as plt import numpy as np dist_1 = Weibull_Distribution(alpha=200, beta=3) dist_2 = Weibull_Distribution(alpha=900, beta=4) plt.subplot(121) # this is for the PDFs ...
StarcoderdataPython
4817109
import sys import subprocess if len(sys.argv)<5: print("usage: generaposter.py <title> <name> <date> <address>") sys.exit(1) title = sys.argv[1] name = sys.argv[2] date = sys.argv[3] address = sys.argv[4] f = open('BFSposter.svg') filecontents = f.read() filecontents=filecontents.replace('TITLE', title) fil...
StarcoderdataPython
4918453
from django.views.generic.edit import CreateView, UpdateView from .models import TodoEntry class TodoEntryCreate(CreateView): model = TodoEntry template_name = 'todo_create_form.html' fields = ['name'] success_url = '/' def form_valid(self, form): obj = form.save(commit=False) ob...
StarcoderdataPython
3532588
import os from notes import note if __name__ == "__main__": aws_key_id = "AKIAIOSFODNN7EXAMPLE" aws_key_secret = "<KEY>" port = int(os.environ.get("PORT", 5000)) note.run(host='0.0.0.0', port=port, debug=True)
StarcoderdataPython
288664
# Generated by Django 2.2.13 on 2020-10-21 21:20 import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
StarcoderdataPython
9736591
from django.conf.urls import patterns, url urlpatterns = patterns( 'kitsune.kpi.views', url(r'^dashboard$', 'dashboard', name='kpi.dashboard'), )
StarcoderdataPython
69146
<reponame>vvikramb/healthbot-rules #! /usr/bin/env python3 import requests from jnpr.junos import Device from jnpr.junos.utils.config import Config from jnpr.junos.op.ethport import EthPortTable from collections import OrderedDict good_history_uplink = [] def degradation_percent(total_interfaces, current_lldp_interfa...
StarcoderdataPython
3288723
<reponame>yitsushi/pulumi-digitalocean # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from . import _utilities import typing # Export this package's modules as members: from ._enums ...
StarcoderdataPython
5051126
#/usr/bin/python import torch import numpy as np import random from collections import deque from model import LinearQNet, Qtrainer from plotter import plot import config import os # Constant parameters for DQN MAX_MEMORY = 150_000 BATCH_SIZE = 1500 LEARNING_RATE = 0.001 class DQNAgent: def __init__(self, hid...
StarcoderdataPython
3382006
<gh_stars>0 #!/usr/bin/env python2 # copyright (c) 2014 the moorecoin core developers # distributed under the mit software license, see the accompanying # file copying or http://www.opensource.org/licenses/mit-license.php. # # test rpc http basics # from test_framework.test_framework import moorecointestframework fro...
StarcoderdataPython
1964888
<reponame>kellya/jopoin-jrnl #!/bin/env python import yaml import requests import json import sys from datetime import datetime from pathlib import Path import select import click __version__ = "0.3.2" class Journal: """The basic object to track journaly things""" def __init__(self, joplin_url=None, joplin...
StarcoderdataPython
125461
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-09 10:06 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('threads', '0001_initial'), ] operations = [ migrations.RenameField( mod...
StarcoderdataPython
3478656
<reponame>TinkoffCreditSystems/overhave<gh_stars>10-100 import logging from contextlib import contextmanager from typing import Any, Iterator, List import sqlalchemy.orm as so from sqlalchemy.exc import ProgrammingError from overhave.db.base import Session from overhave.db.tables import FeatureType logger = logging....
StarcoderdataPython
351519
<reponame>THM-MA/XSDATA-waypoint from dataclasses import dataclass from .t_correlation_property import TCorrelationProperty __NAMESPACE__ = "http://www.omg.org/spec/BPMN/20100524/MODEL" @dataclass class CorrelationProperty(TCorrelationProperty): class Meta: name = "correlationProperty" namespace ...
StarcoderdataPython
20281
import zipfile zip_file = zipfile.ZipFile("zip_archive.zip", "w") zip_file.write("textfile_for_zip_01") zip_file.write("textfile_for_zip_02") zip_file.write("textfile_for_zip_03") # print(zipfile.is_zipfile("zip_archive.zip")) # zip_file = zipfile.ZipFile("zip_archive.zip") # print(zip_file.namelist()) ...
StarcoderdataPython
1604927
<gh_stars>1-10 #!/usr/bin/env python import os.path from gmprocess.io.fdsn.core import read_fdsn from gmprocess.io.test_utils import read_data_dir from gmprocess.streamcollection import StreamCollection from gmprocess.processing import process_streams def test(): datafiles, origin = read_data_dir('fdsn', 'nc7228...
StarcoderdataPython
159329
# -*- coding: utf8 -*- from time import sleep import gps import gsm import json import sqlite3 db = sqlite3.connect('seaglass.sq3') cur = db.cursor() print 'IMEI =', gsm.getIMEI() while True: xs = gps.readGLL() netscan = gsm.doCNETSCAN() ceng = gsm.getCENG() if netscan: xs['netscan'] = netsca...
StarcoderdataPython
8051032
from covid_test_1.get_covid_data import get_covid_data import pandas as pd import pytest def test_get_covid_data(): """Test the get_covid_data() function""" # Tests that the function returns the correct data for given arguments test_df = pd.DataFrame({'cases': [698], 'cumulative_cases': [161969], 'date_...
StarcoderdataPython
283250
<reponame>deifyed/kaex from kaex.models.resource import Resource class Service(Resource): def __init__(self, app): self.apiVersion = 'v1' self.kind = 'Service' self.metadata = { 'name': app.name } ports = [ { 'port': app.service['port'], 'targetPort...
StarcoderdataPython
1676565
<filename>frappe/patches/v7_1/setup_integration_services.py from __future__ import unicode_literals import frappe from frappe.exceptions import DataError from frappe.utils.password import get_decrypted_password import json app_list = [ {"app_name": "razorpay_integration", "service_name": "Razorpay", "doctype": "Razor...
StarcoderdataPython
5136641
import os import re import unicodedata os.environ.setdefault("DJANGO_SETTINGS_MODULE", "systori.settings") import django django.setup() from systori.apps.task.models import * from systori.apps.project.models import * p22 = Project.objects.get(id=22) for job in p22.jobs.all(): for taskgroup in job.taskgroups.al...
StarcoderdataPython
8138895
from flask import Flask, render_template, redirect, request, flash, jsonify from flask import session from flask_session import Session from celery import Celery # from celery.utils.log import get_task_logger from config import Config from forms import UserNameForm from forms import postUrlForm from markupsafe import e...
StarcoderdataPython
3555563
<reponame>sjyttkl/query_completion """ This script is used to create a summary report of key metrics for each experiment. """ import glob import json import numpy as np import os import pandas import re import code regex_eval = re.compile(r"'(\w*)': '?([^,]+)'?[,}]") def FastLoadDynamic(filename): rows = [] ...
StarcoderdataPython
383001
<reponame>zorua98741/PS4-Rich-Presence-for-Discord from ftplib import FTP # used to establish connection between PC and PS4 from ftplib import error_temp # used for error 421 too many connections (when user connects to FTP server) from os import path ...
StarcoderdataPython
150026
from metrics import calc_stability, full_wer, latency import sys import json import re # Using the given swb code - all relevant files are gathered. code = sys.argv[1] prep = "sw0" + code + "-mono" incsv = "./results/msoft/universal/msoft-" + prep + ".csv" intext = "./results/msoft/system-trans-text/msoft-" + prep + ...
StarcoderdataPython
9798314
<reponame>agilentia/gargoyle<gh_stars>1-10 # -*- coding:utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = True SECRET_KEY = 'NOTASECRET' DATABASES = { 'default': { 'ENGINE': 'django.db.bac...
StarcoderdataPython
3405606
from django.urls import path from . import views urlpatterns = [ path('',views.allblogs, name='blogs'), path('<int:blog_id>/',views.detail_blog, name='detail') ]
StarcoderdataPython
6612973
/home/runner/.cache/pip/pool/21/ba/d4/9081c03433cfa7a8c6f9469405b08168172c6eff9f6aae0bf3ab9ee7fb
StarcoderdataPython