id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
6457185
"""Implementation of :class:`MPmathComplexDomain` class. """ from sympy.polys.domains.realdomain import RealDomain class MPmathComplexDomain(RealDomain): # XXX: tmp solution """Complex domain. """ alias = 'CC_mpmath' def __init__(self): pass
StarcoderdataPython
1951730
<filename>Connections/admin.py from django.contrib import admin from .models import GroupUserConnection, GroupTaskConnection @admin.register(GroupTaskConnection) class GroupTaskConnectionAdminConfig(admin.ModelAdmin): list_display = ('group','task') @admin.register(GroupUserConnection) class GroupUserConnection(...
StarcoderdataPython
11379423
from pystatic.error.errorcode import *
StarcoderdataPython
8102380
import io import logging import struct from . import headers, errors, evlrs from .compression import laszip_decompress from .lasdatas import las14, las12 from .point import dims, record from .vlrs import rawvlr from .vlrs.vlrlist import VLRList logger = logging.getLogger(__name__) def _raise_if_wrong_file_signature...
StarcoderdataPython
6658854
<filename>xsoccer/venues/management/commands/build_venue_table_ALL_FILES.py ### Read from F9 files and construct Teams models import utils.xmls as xml_utils import utils.unicode as unicode_utils import os from venues.models import Venue from django.core.management.base import BaseCommand def is_venue(xml_obj): "...
StarcoderdataPython
5180102
<reponame>zceekja/colour_tree_comp2823 """ Test Tree ========= Checks that your tree performs basic functionality. """ import unittest from colours import Colours from node import Node from tree import Tree class TestTree(unittest.TestCase): """ Checks super basic tree functionality """ def test_p...
StarcoderdataPython
6427179
<reponame>wolfy1339/Kenni<gh_stars>0 #!/usr/bin/env python3 import base64 def irc_cap (kenni, input): cap, value = input.args[1], input.args[2] rq = '' if kenni.is_connected: return if cap == 'LS': if 'multi-prefix' in value: rq += ' multi-prefix' if 'sasl' in valu...
StarcoderdataPython
3200013
<reponame>nickspinale/vim-signed-local-rc<filename>python/slrc/vimsupport.py import os.path from slrc.crypto import sign_file, verify_file from slrc.persist import check_pub_key, trust_pub_key, untrust_pub_key import vim def checked_source(): if ( os.path.isfile('.vimrc') and os.path.isfile('.vi...
StarcoderdataPython
4812133
<gh_stars>1-10 # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import re import parldata_crawler.items from cgi import valid_boundary from collections.abc import Sequence def...
StarcoderdataPython
12865058
''' @Author: Hata @Date: 2020-05-24 15:30:19 @LastEditors: Hata @LastEditTime: 2020-05-24 15:32:04 @FilePath: \LeetCode\230.py @Description: https://leetcode-cn.com/problems/kth-smallest-element-in-a-bst/ ''' class Solution: def kthSmallest(self, root, k): def gen(r): if r is not None: ...
StarcoderdataPython
5154209
import turbodbc import _config as config C = turbodbc.connect(**config.turbodbc_connection_options) cur = C.cursor() cur.execute("ALTER SESSION SET QUERY_CACHE = 'OFF'") cur.execute(f"SELECT * FROM {config.table_name}") df = cur.fetchallarrow().to_pandas() df.info()
StarcoderdataPython
8115180
<gh_stars>1-10 # Copyright 2017 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 requ...
StarcoderdataPython
8044572
import os file_path = os.path.join('.', 'colab_file.txt') if os.path.exists(file_path): os.remove(file_path) count = 0 with open(file_path, 'a') as to_write: for root, dirs, _ in os.walk(os.path.join("..", "..", "data")): for dir in dirs: dir_path = os.path.join(root, dir) fo...
StarcoderdataPython
1636804
# Each segment has another segment of the image showing (not black) # As if you are slowly lookinng at someone's face from above # Segment numbers are as follows: # 1. Forehead (dowm to eyebrows) # 2. Eyebrows (down to eyes) # 3. Eyes # 4. Nose # 5. Mouth # 6. Chin # 7. Full import logging import numpy as np import o...
StarcoderdataPython
4807647
# 符号反転 import numpy as np import npu import matplotlib.pyplot as plt def save_img(fname: object, V: object, q_V: object, deq_V: object, n: object = 1) -> object: x = np.arange(0, 1024) plt.figure(n) plt.plot(x, V, color="green") plt.plot(x, q_V, color="b") plt.plot(x, deq_V, color="r") plt.sav...
StarcoderdataPython
200032
<reponame>loveorchids/deformable_detection from imgaug import augmenters def aug_temp(args, bg_color=255): aug_list = [] stage_0, stage_1, stage_2, stage_3 = 2048, 2048, 512, 512 # Pad the height to stage_0 aug_list.append(augmenters.PadToFixedSize(width=1, height=stage_0, pad_cval=bg_color)) # Re...
StarcoderdataPython
5041265
"""FASTAPI OpenAPI/REST app.""" import logging from pathlib import Path from typing import List from fastapi import FastAPI, HTTPException, Response, status from fastapi.middleware.cors import CORSMiddleware from fastapi.staticfiles import StaticFiles from pydantic import BaseModel, Field log = logging.getLogger("uvi...
StarcoderdataPython
11373638
# coding: utf-8 """ Phaxio API API Definition for Phaxio OpenAPI spec version: 2.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import # import models into sdk package from .models.account_status import AccountStatus from .models.accou...
StarcoderdataPython
8137174
<reponame>HiAwesome/python-algorithm<filename>c07/p296.py<gh_stars>1-10 from pythonds.graphs import PriorityQueue, Graph, Vertex def prim(G: Graph, start: Vertex): pq = PriorityQueue() for v in G: v.setDistance(sys.maxsize) v.setPred(None) start.setDistance(0) pq.buildHeap([(v.getDis...
StarcoderdataPython
6511184
"""Module for Testing the Meetup Endpoint.""" import json # Local Import from .basecase import TestBaseCase as base class TestMeetup(base): """Testing the Meetup Endpoints with valid input.""" def setUp(self): base.setUp(self) def test_create_meetup(self): """Testing Creation of a Meetu...
StarcoderdataPython
45545
<filename>src/modules/podcast/tasks/rss.py import os from jinja2 import Template from core import settings from common.storage import StorageS3 from common.utils import get_logger from modules.podcast.models import Podcast, Episode from modules.podcast.tasks.base import RQTask, FinishCode logger = get_logger(__name_...
StarcoderdataPython
3232510
import numpy as np import pylas def test_mmap(mmapped_file_path): with pylas.mmap(mmapped_file_path) as las: las.classification[:] = 25 assert np.all(las.classification == 25) las = pylas.read(mmapped_file_path) assert np.all(las.classification == 25)
StarcoderdataPython
150072
from . import channels from . import paillier
StarcoderdataPython
3289303
<gh_stars>0 import pytest import falcon from falcon import MEDIA_TEXT def test_response_set_content_type_set(): resp = falcon.Response() resp._set_media_type(MEDIA_TEXT) assert resp._headers['content-type'] == MEDIA_TEXT def test_response_set_content_type_not_set(): resp = falcon.Response() ass...
StarcoderdataPython
8144328
<filename>netforce_account_report/netforce_account_report/models/report_cash_flow.py<gh_stars>10-100 # Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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 Soft...
StarcoderdataPython
8072551
<gh_stars>1-10 from pathlib import Path test_input = """[({(<(())[]>[[{[]{<()<>> [(()[<>])]({[<{<<[]>>( {([(<{}[<>[]}>{[]{[(<()> (((({<>}<{<{<>}{[]{[]{} [[<[([]))<([[{}[[()]]] [{[{({}]{}}([{[{{{}}([] {<[[]]>}<{[{[{[]{()[[[] [<(<(<(<{}))><([]([]() <{([([[(<>()){}]>(<<{{ <{([{{}}[<[[[<>{}]]]>[]]""" # test_input = """<...
StarcoderdataPython
348818
#1 f = open('Grade2.txt', "a") Score = open('Score1.txt',"r") g=0 ll = Score.readline() while ll != "": l = ll.split(",") #print(l) eee = l[4][0:2] e = int(eee) if g <= e: g=e else: g=g ll = Score.readline() print(ll) f.write(str(g)) f.close() Score.close()
StarcoderdataPython
11257322
friendNames = ['Joan', 'Ronan', 'Nikita', 'Augustus'] friendIndex = 0 while friendIndex < len(friendNames): friendName = friendNames[friendIndex] hero.say(friendName + ', go home!') friendIndex += 1 hero.moveXY(20, 30) hero.buildXY("fence", 30, 30)
StarcoderdataPython
4977279
<filename>cnosolar/gui_config.py ############################### # CONFIGURATION GUI # ############################### import json import pytz import pvlib import requests import traitlets import numpy as np import pandas as pd import ipywidgets as widgets from tkinter import Tk, filedialog from IPython.disp...
StarcoderdataPython
3452604
<reponame>UtkarshPathrabe/Competitive-Coding class Solution: def search(self, nums: List[int], target: int) -> bool: if len(nums) == 0: return False start, end = 0, len(nums) - 1 def isBinarySearchHelpful(start, element): return nums[start] != element def exis...
StarcoderdataPython
9786171
<filename>website/admin.py from django.contrib import admin from website.models import contact # Register your models here. class contactAdmin(admin.ModelAdmin) : date_hierarchy = 'created_date' list_display = ('name','email','created_date','subject') list_filter = ('email',) search_fields = ('name','...
StarcoderdataPython
4848
<filename>tensorflow_rnn/mnist_lstm.py<gh_stars>0 import numpy as np import tensorflow as tf """ Do an MNIST classification line by line by LSTM """ (x_train, y_train), \ (x_test, y_test) = tf.keras.datasets.mnist.load_data() x_train, x_test = x_train/255.0, x_test/255.0 model = tf.keras.Sequential() model.add(t...
StarcoderdataPython
142916
# encoding: utf-8 """ Training implementation Author: <NAME> Update time: 08/11/2020 """ import re import sys import os import cv2 import time import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.optim import lr_scheduler import torch.optim as optim import torchvision im...
StarcoderdataPython
1688379
<filename>wavepy3/__init__.py from .atmos import Atmos from .constraint_analysis import constraint_analysis from .prop import split_step from . import analytic from . import sources
StarcoderdataPython
1668316
import pyautogui import time import json from old_info import kols # 摁chrome浏览器 link_num = 137 link_num_end = len(kols) link_num_str = "" action_list = [ { "name":"摁chrome浏览器", "x":618, "y":800 - 25, "action":"move_and_click", "sleep": 1 }, { "name":"摁pgy tab...
StarcoderdataPython
12848657
<filename>plane_waves/polarization_animation.py #---------------------------------------------------------------------- # # 9/25/18 - Update to use Python 3.6, PyQt5 and pyqtgraph 0.10.0 # <NAME> #---------------------------------------------------------------------- from PyQt5 import QtGui, QtCore import pyqtgraph as...
StarcoderdataPython
3449470
print '---- THIS CODE REQUIRES CHAINER V3 ----' import warnings warnings.simplefilter('ignore', UserWarning) warnings.simplefilter('ignore', RuntimeWarning) warnings.simplefilter('ignore', FutureWarning) import numpy as np import time, os, copy, random, h5py from argparse import ArgumentParser import chainer import ...
StarcoderdataPython
5089823
<reponame>aotuai/brainframe-qt from .detection_item import DetectionItem from .detection_polygon_item import DetectionPolygonItem
StarcoderdataPython
6666550
<filename>cast/cast.py<gh_stars>0 #!/usr/bin/env python3 # CAST main class # Author: <NAME> (<EMAIL>) import os import sys import json from cast.compile_command_parser import read_db class Cast: """ Main Cast class """ def __init__(self): self.compile_db = "" self.template = "" ...
StarcoderdataPython
6699466
<gh_stars>0 from django.test import SimpleTestCase from django.utils.crypto import get_random_string from zentral.contrib.santa.serializers import RuleUpdateSerializer class SantaSerializersTestCase(SimpleTestCase): def test_rule_wrong_policy_for_bundle_rule(self): data = {"rule_type": "BUNDLE", ...
StarcoderdataPython
9795233
<gh_stars>0 P,Pen = 0,0 while 1: Hex = H*(2 * H - 1) while Pen < Hex: P += 1 Pen = int( 0.5 * P * (3*P - 1 )) if not Pen == Hex: continue print Tri,Hex,Pen break
StarcoderdataPython
1921922
from django.contrib import admin from django.urls import path, include, re_path from django.views.generic import TemplateView from django.conf import settings from django.conf.urls.static import static import rest_framework from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView urlpatterns =...
StarcoderdataPython
1624835
import sys, struct, random, string, meterpreter_bindings # A stack of this stuff was stolen from the Python Meterpreter. We should look # to find a nice way of sharing this across the two without the duplication. # # START OF COPY PASTE # # Constants # # these values will be patched, DO NOT CHANGE THEM DEBUGGING = F...
StarcoderdataPython
1968539
import numpy as np from scipy import misc import matplotlib.pyplot as plt def psnr(im1, im2): """ im1 and im2 value must be between 0 and 255""" im1 = np.float64(im1) im2 = np.float64(im2) rmse = np.sqrt(np.mean(np.square(im1[:] - im2[:]))) psnr = 20 * np.log10(255 / rmse) return psnr, rmse de...
StarcoderdataPython
6586564
import sys import argparse import numpy as np import math def isCtoT(site): return any([(s[0]=='C' and s[-1] =='T') for s in site.split(',')]) def isGtoT(site): return any([(s[0]=='G' and s[-1] =='T') for s in site.split(',')]) def isRare(n,cutoff): return (n <= cutoff) def isExtremal (s, n, cutoff, mi...
StarcoderdataPython
3582930
#!/usr/bin/env python2.7 # Permutations of bits to figure out the proper bit order from a fully # undocumented SoC implementation whose name if being kept secret :-) from array import array from binascii import unhexlify from neo.bits import BitSequence from neo.util import crc16 def l2a(l): return array('B', l)...
StarcoderdataPython
1806852
from django.db.models.signals import post_save from django.db import models from django.contrib.auth.models import User from videos.models import Video, Tag # Create your models here. class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) image = models.ImageField(default='def...
StarcoderdataPython
8037273
<filename>posts/urls.py<gh_stars>1-10 from django.urls import path from . import views urlpatterns = [ path('home/', views.home, name="home"), path('friends-home/', views.friends_home, name="friends-home"), path('profile/', views.profile_without_user, name="profile"), path('profile/<str:username>/', v...
StarcoderdataPython
4947369
<reponame>Karmantez/MachineLearning_Practice #!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd def get_new_feature_name_df(old_feature_name_df): feature_dup_df = pd.DataFrame(data=old_feature_name_df.groupby('column_name').cumcount(), columns=['dup_cnt']) feature_dup_df = ...
StarcoderdataPython
1797387
<gh_stars>1-10 """ Steve has a string, , consisting of lowercase English alphabetic letters. In one operation, he can delete any pair of adjacent letters with same value. For example, string "aabcc" would become either "aab" or "bcc" after operation. Steve wants to reduce as much as possible. To do this, he will rep...
StarcoderdataPython
3273717
# app/context_processors.py def blogcategories(request): from olympicvaxinfo.models import Category return {'blogcategories': Category.objects.all().order_by('-name')}
StarcoderdataPython
9766483
<filename>keyboards/__init__.py from .inlinekb import select_storage_kb from .inlinekb import what_to_store_kb from .inlinekb import season_things_kb from .inlinekb import weeks_or_months_kb from .inlinekb import pay_kb from .inlinekb import back_kb from .replykb import get_location_kb __all__ = [ select_storage_k...
StarcoderdataPython
1777515
<gh_stars>0 from __future__ import division import numpy as np def make_load_func(plan): def getload(t): return plan[t-1] # ff model plans start with index 1 return getload def g(t, tau_1, w): '''time continuous version of g''' return w(t) * np.exp(-t/tau_1) def discrete_g(n, tau_1, w):...
StarcoderdataPython
36106
<gh_stars>1-10 import os import cv2 from ReceiptGenerator.draw_receipt import create_crnn_sample NUM_OF_TRAINING_IMAGES = 3000 NUM_OF_TEST_IMAGES = 1000 TEXT_TYPES = ['word', 'word_column', 'word_bracket', 'int', 'float', 'price_left', 'price_right', 'percentage'] # TEXT_TYPES = ['word'] with open('./ReceiptProcess...
StarcoderdataPython
1700464
<reponame>Zylphrex/drakma from django.conf import settings from django.db import models from api.models import Account class CurrentAccount(models.Model): user = models.OneToOneField(settings.AUTH_USER_MODEL, unique=True, on_delete=models.CASCADE) account = models.ForeignKey(Account, on_delete=models.CASCADE...
StarcoderdataPython
11264454
from js9 import j from zerorobot.template.base import TemplateBase class IpmiClient(TemplateBase): version = '0.0.1' template_name = "ipmi_client" def __init__(self, name=None, guid=None, data=None): super().__init__(name=name, guid=guid, data=data) def validate(self): # client inst...
StarcoderdataPython
3329720
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import json import os import re import subprocess import sys from string import Template DOCKER_IMAGE_NAME_RE = re.compile(r"^([a-zA-Z0-9_.]+/)?[a-zA-Z0-9_.]+$") DOCKER_IMAGE_TAG_RE = re.compile(r"^[a-zA-Z0-9_.]+$") ARCHIVE_NAME_VALID_CHAR_RE = re.compile...
StarcoderdataPython
6706344
<reponame>ulope/raiden-contracts import pytest from eth_tester.exceptions import TransactionFailed from raiden_contracts.constants import EVENT_TOKEN_NETWORK_CREATED from .fixtures.config import ( raiden_contracts_version, empty_address, fake_address, ) from raiden_contracts.utils.events import check_token_...
StarcoderdataPython
3316359
""" 独立出来的标尺编辑窗口类。架空主程序中相关部分。 2018.12.14修改,将main设为可选,保证可以从数据库独立调用。 """ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import Qt from .rulerTabWidget import RulerTabWidget from .data.line import Line, Ruler class RulerWidget(QtWidgets.QTabWidget): okClicked = QtCore.pyqtSignal() showStatus = QtCor...
StarcoderdataPython
5107033
<filename>organice/bin/__init__.py """ Scripts for managing the django Organice project. """
StarcoderdataPython
325790
# BSD 2-Clause License # # Copyright (c) 2020, <NAME> (<EMAIL>) # # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # ...
StarcoderdataPython
3458074
import os, re, yaml from mdfile import MdFile RE_MDLINK = r'(?<=\[{2})(.*?)(?=\]{2})' # [[link]] RE_MDFM = r'(?<=(\-{3}))(.*?)(?=(\-{3}))' # front matter yaml class MdParser(): def __init__(self, target_dir): self.pages = [] self.target_dir = target_dir # parse markdown front matter (yaml)...
StarcoderdataPython
3235228
from spinnman.messages.eieio.data_messages.eieio_data_message\ import EIEIODataMessage from spinnman.exceptions import SpinnmanInvalidParameterException from spinnman.messages.eieio.data_messages.eieio_key_payload_data_element \ import EIEIOKeyPayloadDataElement class EIEIOWithPayloadDataMessage(EIEIODataMess...
StarcoderdataPython
3486044
import time import unittest from tests.integration.programs import validations as validations_module class TestGooeyIntegration(unittest.TestCase): """ A few quick integration tests that exercise Gooey's various run modes WX Python needs to control the main thread. So, in order to simulate a u...
StarcoderdataPython
5070524
from flask_wtf import FlaskForm from wtforms import StringField, SelectField, TextAreaField, SubmitField, SelectMultipleField from wtforms.validators import DataRequired, Email from ..models import User class ProfileUpdate(FlaskForm): profile_bio=TextAreaField('Tell us about yourself.', validators=[DataRequired()...
StarcoderdataPython
4843639
from libs.generate_fingerprint import fingerprint from libs.constants import * from itertools import zip_longest from libs.db import get_conn import math def find_matches(channel, sampling_rate=DEFAULT_SAMPLING_RATE, args='remote'): """Matches audio fingerprints. Fingerprints of an audio channel is matched a...
StarcoderdataPython
1619079
<reponame>odoochain/addons_oca<filename>addons14/knowledge_attachment_category/__manifest__.py { "name": "Knowledge Attachment Category", "summary": "Glue module between knowledge and attachment_category", "version": "14.0.1.0.0", "category": "Knowledge", "website": "https://github.com/OCA/knowledge...
StarcoderdataPython
5137246
<filename>code.py import time import analogio import digitalio import board sample_speed = .01 tcslip_time = (0.0, 6.7, 13.3, 20.0) tcslip_retard = (0.0, 3.3, 6.7, 10.0) slip_percent = .10 tc_active_above = 50 slip_window_min = .01 slip_window_max = .05 slip_window = 0.01 magic_number = 200 my_slip = 0 my_retard = 0 ...
StarcoderdataPython
11318584
""" * Assignment: <NAME> * Complexity: medium * Lines of code: 20 lines * Time: 21 min English: TODO: English Translation X. Run doctests - all must succeed Polish: 1. Z podanego powyżej adresu URL pobierz dane 2. Dla każdego gatunku 3. Dane stosunku `sepal_length` do `sepal_width` zwizualizuj w f...
StarcoderdataPython
11347924
import Question from Question_Class import Question_Class # We are building questions to answers questionsandAnswers = [Question_Class(Question.questionsList[0], "a"), Question_Class(Question.questionsList[1], "b"), Question_Class(Question.questionsList[2], "b") ...
StarcoderdataPython
3243537
from flask import Flask, render_template, request, flash, redirect, url_for from flask_login import LoginManager, UserMixin, current_user, login_user, logout_user from flask_sqlalchemy import SQLAlchemy from models import * import os ALLOWED_EXTENSIONS = set(['jpg']) app = Flask(__name__, static_url_path='/static') ap...
StarcoderdataPython
5193758
<gh_stars>1-10 from datetime import datetime import numpy as np from pytz import timezone from thermophysical import p_atm, \ T_env, \ d_from_p_t, \ d_from_p_sl, \ h_from_p_sl, \ h_from_p_sv, \ r_from_p_sl # liquefier data v_linde_dewar_L_hr = 54.4 # production rate [L/hr] p_linde_dewar_gauge_...
StarcoderdataPython
347127
#!/usr/bin/env python # coding:utf-8 #code by:YasserBDJ96 #email:<EMAIL> #START{ from setuptools import setup,find_packages setup( name="timeloading", version="0.0.1", author="YasserBDJ96", author_email="<EMAIL>", description='''Animated loading bar. This package is a loading bar that a...
StarcoderdataPython
9616229
<reponame>plegulluche/OPC-p7 import json from grandpy.apigoogle import Apigoogle def mock_requestget(*args, **kwarg): class mock_response: def __init__(self): datastructure = { "results": [ { "adress_components": ["some irrelevants co...
StarcoderdataPython
9676978
<reponame>michaelwang123/PaddleRec # Copyright (c) 2020 PaddlePaddle 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/LICEN...
StarcoderdataPython
4898497
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2017-08-12 05:23 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('tickets', '0008_ticket_created_tickets'), ] operati...
StarcoderdataPython
12811756
<gh_stars>0 #!/usr/bin/env python import rospy import cv2 import numpy as np from cv_bridge import CvBridge, CvBridgeError from geometry_msgs.msg import Twist from sensor_msgs.msg import Image from move_robot import MoveKobuki class LineFollower(object): def __init__(self): self.bridge_object = CvBri...
StarcoderdataPython
8109281
import asyncio import datetime import freezegun import itertools import operator import pytest import pytest_mock import pydantic import re import servo import servo.pubsub import servo.utilities.pydantic import weakref from typing import Callable, List, Optional class TestMessage: def test_text_message(self) ->...
StarcoderdataPython
1884366
<gh_stars>0 from django.urls import path from django.conf import settings from django.conf.urls.static import static from . import views urlpatterns = [ path('', views.index, name='index'), path('profile/', views.profile, name='profile'), path('update/', views.update_profile, name='update'), path('hou...
StarcoderdataPython
6530478
import sys, ast import sage class FileInfo(): def __init__(self, filename, node): self.filename = filename self.lineno = node.lineno self.col_offset = node.col_offset class stack(): def __init__(self): self._stack = [] def push(self, obj): self._stack.append(obj) def pop(self, expect...
StarcoderdataPython
3555274
<filename>web_api/news/outputs/fetch_result.py #!/usr/bin/env python # encoding: utf-8 """ @author: zhanghe @software: PyCharm @file: fetch_result.py @time: 2018-05-30 19:34 """ from __future__ import unicode_literals from flask_restful import fields fields_item_fetch_result = { 'id': fields.Integer, 'task...
StarcoderdataPython
8093365
<reponame>ZhizhongPan/algo_trade<filename>algotrade/technical/abstract.py #!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'phil.zhang' import inspect import talib.abstract as ab import numpy as np import ls_talib _LS_FUNCTION_NAMES = set(ls_talib.__all__) # TODO: 遇到问题:如果用jit修饰后,无法用inspect获得默认参数 class...
StarcoderdataPython
1784063
<gh_stars>0 import yaml import ocdsmerge DEFAULT_EXTENSIONS = [ "https://raw.githubusercontent.com/open-contracting/api_extension/eeb2cb400c6f1d1352130bd65b314ab00a96d6ad/extension.json" ] def prepare_record(releases, ocid): if not isinstance(releases, list): releases = [releases] record = { ...
StarcoderdataPython
5138383
<reponame>vaibhav92/op-test-framework #!/usr/bin/env python2 # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licen...
StarcoderdataPython
3249127
<filename>folderlib/data/excluded.py __all__ = [ "binaries", "symlinks", ] binaries = [ "exe", "out", "bin" ] symlinks = ["lnk"]
StarcoderdataPython
3595554
<gh_stars>1-10 from ..models import District legacy_districts = { "md": [ District("12A", "lower", division_id=None), District("12B", "lower", division_id=None), District("2C", "lower", division_id=None), District("30", "lower", division_id=None), District("31", "lower", div...
StarcoderdataPython
1924928
<reponame>dirty-cat/categorical-encoding<filename>benchmarks/similarity_scores_time_benchmark.py """ Benchmark time consumption and scores for K-means and most frequent strategies. We use the traffic_violations dataset to benchmark the different dimensionality reduction strategies used in similarity encoding. Paramet...
StarcoderdataPython
1722422
<filename>custom_imports/sample_importers/__init__.py from custom_imports.sample_importers.config_importer import cfg_importer, ini_importer from custom_imports.sample_importers.csv_importer import CSVImporter from custom_imports.sample_importers.json_importer import json_importer __all__ = ["json_importer", "cfg_impo...
StarcoderdataPython
11219852
<reponame>shivharis/pybind from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.ba...
StarcoderdataPython
6581829
<gh_stars>1-10 from .contrib import drivers from .contrib import providers
StarcoderdataPython
1658019
#!/usr/bin/env python ################################################################################ # # A poorly written Slack integration that enables querying Virustotal # directly from Slack # # https://github.com/ecapuano/slackbot # ##############################################################################...
StarcoderdataPython
4841826
<gh_stars>1-10 import sys def prt(out=sys.stdout): out.write('Just a simple print\n')
StarcoderdataPython
8123448
# Copyright 2018 D-Wave Systems 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 or...
StarcoderdataPython
170804
""" Test of the Turbidity meter using an ADC # The Turbidity sensor mapped from 0 to 1023 (0 - 5 volts) # ADC maps values -32768 to 32767, GND is 0 (-5 - 5 v) # Voltage conversion is volts = (reading / 32767) * 5 # This may need some calibration adjustment """ # Import the ADS1x15 module. from ADS1115 import ADS1115 ...
StarcoderdataPython
3516504
<gh_stars>10-100 import abc from typing import cast from overhave import db from overhave.entities import FeatureTypeModel class BaseFeatureTypeStorageException(Exception): """ Base exception for :class:`FeatureTypeStorage`. """ class FeatureTypeNotExistsError(BaseFeatureTypeStorageException): """ Exceptio...
StarcoderdataPython
1973581
from flaskapp.models.persist import Persistent import os if __name__ == "__main__": print(os.getcwd()) p = Persistent(max_tries=15) del p
StarcoderdataPython
1589
def main(expr): openingParams = '({[' closingParams = ')}]' stack = [] for c in expr: if c in openingParams: stack.append(c) elif c in closingParams: topOfStack = stack.pop() openingIndex = openingParams.find(topOfStack) closingIndex = clos...
StarcoderdataPython
1934555
<gh_stars>1-10 # Non Parsed URL Model from crawler.crawler_instance.constants.strings import STRINGS class image_model: m_url = STRINGS.S_EMPTY m_type = STRINGS.S_EMPTY def __init__(self, p_url, p_type): self.m_url = p_url self.m_type = p_type
StarcoderdataPython
5180271
import requests from bs4 import BeautifulSoup def macs_search(search_string): """ Search https://www.macscomics.com.au/ Email Us <EMAIL> Location Shop 2/34 Sydney Street Mackay QLD """ shop = "Mac's Comics" # ROOT OF URL FOR SEARCH base_search_url = "https://www.macscomics.com.a...
StarcoderdataPython
62913
<filename>mopidy_sangu/api/__init__.py import logging import string import random from mopidy_sangu.storage import VoteDatabaseProvider from mopidy_sangu.api.admin import AdminRequestHandler from mopidy_sangu.api.unvote import UnVoteRequestHandler from mopidy_sangu.api.vote import VoteRequestHandler from mopidy_sangu....
StarcoderdataPython