id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
264217
import time from random import choice from tests_steps.banners_steps import * from tests_steps.browser_config import * def test_submit_random_form_in_full_hd(): browser = setup_remote_browser(os='OSX_Catalina', size='Full HD', polling_time=5) try: browser.get(config.BASE_URL) banners_containe...
StarcoderdataPython
3501295
<reponame>tdcosim/SolarPV-DER-simulation-utility """Grid model and shared attributes.""" from __future__ import division import numpy as np import math import cmath import six from pvder import utility_functions class BaseValues(): """Class to store base values.""" Vbase = 500.0 #L-G peak" Sbase = 50e3 #VA base...
StarcoderdataPython
3437465
<filename>Problems/Poster artist/task.py word = input() print(word.upper())
StarcoderdataPython
1678090
<reponame>niallscc/Optimus from optimus.engines.base.dask.dataframe import DaskBaseDataFrame from optimus.engines.cudf.dataframe import CUDFDataFrame from optimus.engines.dask.io.save import Save from optimus.engines.pandas.dataframe import PandasDataFrame from optimus.helpers.converter import pandas_to_dask_dataframe ...
StarcoderdataPython
397590
<reponame>dendisuhubdy/grokmachine<filename>Vault7/Lost-in-Translation/windows/fuzzbunch/command.py<gh_stars>10-100 """ Derived command line processing handler class from the Python standard module 'cmd'. Many methods overridden to support more FB like behavior. """ import string import subprocess import time from c...
StarcoderdataPython
3484493
<reponame>jwspaeth/simple_ml<filename>simple_ml/predict.py<gh_stars>0 def predict(): pass
StarcoderdataPython
1706122
import random as aleas import matplotlib.pyplot as plt from scipy.signal import freqz import numpy as np import pandas as pd import statsmodels.api as sm """ random : pour generer des nombres aleatoires matplotlib.pyplot : pour generer des graphiques et gerer leur construction scipy.signal : pour avoir le T...
StarcoderdataPython
1768994
<reponame>SebastianPartarrieu/ThroughArtistsEyes import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from os import listdir from numpy import asarray from numpy import vstack from numpy import savez_compressed from numpy import load from keras.preprocessing.image import img_to_array from keras...
StarcoderdataPython
3574471
<filename>circles/tests/test_commands.py import datetime import pytz from django.test import TestCase from django.core import mail from django.core.management import call_command from django.contrib.auth import get_user_model from circles.models import Event, MailTemplate User = get_user_model() class CheckSeminar...
StarcoderdataPython
8180995
# 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
1658812
# -*- coding: utf-8 -*- from django.test.client import Client from networkapi.test.test_case import NetworkApiTestCase from networkapi.util.geral import mount_url class PeerGroupPostSuccessTestCase(NetworkApiTestCase): peer_group_uri = '/api/v4/peer-group/' fixtures_path = 'networkapi/api_peer_group/v4/fixt...
StarcoderdataPython
5026184
import pandas as pd import pandas._testing as tm def test_getitem_callable(): # GH 12533 s = pd.Series(4, index=list("ABCD")) result = s[lambda x: "A"] assert result == s.loc["A"] result = s[lambda x: ["A", "B"]] tm.assert_series_equal(result, s.loc[["A", "B"]]) result = s[lambda x: [Tru...
StarcoderdataPython
113399
#!/usr/bin/python3 import hid import traceback hid_max_pkt_size = 64 if __name__ == '__main__': import argparse import sys import binascii parser = argparse.ArgumentParser() parser.add_argument('-d', '--descriptor', help='Print Descriptor', action='store_true') args = parser.parse_args(...
StarcoderdataPython
100829
import collections.abc from itertools import repeat container_abcs = collections.abc def _ntuple(n): def parse(x): if isinstance(x, container_abcs.Iterable): return x return tuple(repeat(x, n)) return parse _single = _ntuple(1) _pair = _ntuple(2) _triple = _ntuple(3) _quadruple = ...
StarcoderdataPython
6631686
<gh_stars>10-100 import sys import os from setuptools import setup import setuptools.command.build_py from distutils.extension import Extension PROJECT_METADATA = { "version": "0.1.0.dev2", "author": '<NAME>', "author_email": '<EMAIL>', "license": 'MIT', } METADATA_TEMPLATE = """ __version__ = "{versi...
StarcoderdataPython
11305058
import json from functools import cmp_to_key from mock import patch from django.urls import reverse from django.test import override_settings from seahub.test_utils import BaseTestCase from seahub.trusted_ip.models import TrustedIP from seahub.api2.endpoints.admin.device_trusted_ip import cmp_ip @override_settings(EN...
StarcoderdataPython
5066329
<filename>Develop/subgroup3_dev/movies/admin.py<gh_stars>10-100 from django.contrib import admin # Register your models here. # #http://127.0.0.1:8000/admin/ # hoseong // 12 or 123 from . import models @admin.register(models.Actor) class ActorAdmin(admin.ModelAdmin): fieldsets = ( ( "Basic In...
StarcoderdataPython
135933
from django.db import models from general_business.models import Organization # Create your models here. class Campaign(models.Model): title = models.CharField( max_length = 300, verbose_name = "Campaign Title" ) subtitle = models.CharField( max_length=300, verbose_...
StarcoderdataPython
8198666
<reponame>Zhenye-Na/leetcode<gh_stars>1-10 # # @lc app=leetcode id=927 lang=python3 # # [927] Three Equal Parts # # https://leetcode.com/problems/three-equal-parts/description/ # # algorithms # Hard (34.82%) # Likes: 547 # Dislikes: 92 # Total Accepted: 20.4K # Total Submissions: 53K # Testcase Example: '[1,0,1,...
StarcoderdataPython
11375579
<gh_stars>10-100 from submin.models import storage as models_storage storage = models_storage.get("hookjobs") def jobs(repositorytype, repository, hooktype): return storage.jobs(repositorytype, repository, hooktype) def queue(repositorytype, repository, hooktype, content): return storage.queue(repositorytype, repos...
StarcoderdataPython
1624464
numbers = [int(el) for el in input().split(", ")] positive = [str(x) for x in numbers if x >= 0] negative = [str(x) for x in numbers if x < 0] even = [str(x) for x in numbers if x % 2 == 0] odd = [str(x) for x in numbers if not x % 2 == 0] print("Positive:", ', '.join(positive)) print("Negative:", ', '.join(negative)...
StarcoderdataPython
3552035
# Copyright 2019 Alorium Technology, LLC. # # This utility is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # This utilit...
StarcoderdataPython
6546840
# -*- coding: utf-8 -*- """ hunk.server ~~~~~~~~~~~ Provides mock server that has JSON API. """ import argparse import os from flask import Flask, request, make_response, abort import requests from .resource import load_resource from .production import ProductionEnvironment METHODS = ['GET', 'HEAD', 'POST', 'PUT...
StarcoderdataPython
11343438
# Copyright 2021 The Distla Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
StarcoderdataPython
1982419
import mock import transaction import zeit.cms.celery import zeit.workflow.testing @zeit.cms.celery.task(queuename='publish_homepage') def hp_task(): """Task with queue homepage.""" @zeit.cms.celery.task def no_default_queue(): """Task without a default queue.""" class RouteTaskTests(zeit.cms.testing.Func...
StarcoderdataPython
6598571
<gh_stars>1-10 # -*- coding: utf-8 -*- # Copyright (c) 2021 by <NAME> import re import ast import random from tqdm import tqdm from unicodedata import normalize as nl def cleanning_text(text): # TODO: Unicode text text = nl('NFKC',text) # TODO: Remove emotion icon emoji_pattern = re.compile("[" ...
StarcoderdataPython
3460863
<filename>main.py<gh_stars>0 import yfinance as yf import matplotlib.pyplot as plt import pandas as pd import seaborn as sb from hashlib import sha256 stonks = ['ACN', 'MSFT', 'DIS', 'V', 'NVDA', 'PEP', 'AAPL', 'GOOGL', 'VOT', 'DGRO','SPHD','VWO', 'VEA', 'VCLT', 'SPLB', 'IGLB'] unique_filename = sha256(''.join(stonks)...
StarcoderdataPython
12856065
class Student: def __init__(self,name,major,gpa): self.name=name self.major=major self.gpa=gpa def on_honor_roll (self): if self.gpa>=8.5: return True else: return False
StarcoderdataPython
9790122
<reponame>bartezza/hydrafw<gh_stars>0 import time from pynfcreader.devices.hydra_nfc import HydraNFC from pynfcreader.sessions.iso14443.iso14443a import Iso14443ASession from pynfcreader.tools import utils import pyHydrabus import logging # n=pyHydrabus.NFC('/dev/hydrabus') # >>> # Set mode to ISO 14443A # >>> n.mode...
StarcoderdataPython
4986698
<reponame>saberworks/massassi-django<gh_stars>0 from django import forms class NewsSearchForm(forms.Form): required_css_class = 'required' terms = forms.CharField( label="Search For", strip=True, help_text="enter keywords to search for", required=True, )
StarcoderdataPython
8024173
<reponame>n0npax/lime-comb import builtins import tempfile from lime_comb.auth.google import get_anon_cred from lime_comb.main import * from .conftest import * class TestHelperFunctions: def test_parse_common_version(self, capsys, mocker): mocker.patch.object(sys, "exit") base_parser(["--version...
StarcoderdataPython
8138877
<gh_stars>0 from datetime import datetime from flask import Flask, render_template import re import sys from simple_vbb.vbb import Vbb, DummyVbb, AccessKeyMissingException app = Flask(__name__) str_to_ext_id_cache = {} def resolve_station(search_str): if search_str in str_to_ext_id_cache: return str_to...
StarcoderdataPython
8035414
<reponame>dmontoya1/cajas # Generated by Django 2.0.9 on 2019-07-03 19:25 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('users', '0012_auto_20190611_2204'), ] operations = [ migrations.AddField( ...
StarcoderdataPython
81341
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'leftplusminusnonassocadvdisadvadv dice disadv div minus newline number plus space star tabcommand : roll_list\n | mod_list\n ...
StarcoderdataPython
348444
import logging import types import os import sys from typing import Iterable, Optional, Set, List, Dict, Any, Union, Tuple from getpass import getuser from powar.settings import AppSettings from powar.util import saved_sys_properties, read_header, run_command, RunCommandResult, realpath logger: logging.Logger = loggi...
StarcoderdataPython
3260769
<reponame>metaprov/modeldapi<gh_stars>1-10 # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from github.com.metaprov.modelaapi.services.webrequestrun.v1 import webrequestrun_pb2 as github_dot_com_dot_metaprov_d...
StarcoderdataPython
8117034
# Copyright <NAME> 2019-2021. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import jax import jax.numpy as jnp import scipy jax.config.update("jax_enable_x64", True) def gaussian_decay(x, *...
StarcoderdataPython
1996206
<filename>libcst/_parser/_types/production.py # 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. # pyre-strict from dataclasses import dataclass @dataclass(frozen=True) class Production: ...
StarcoderdataPython
12863006
<gh_stars>1-10 import sqlite3 from flask import Flask, render_template app = Flask(__name__) # database details - to remove some duplication db_name = 'shopping_data.db' @app.route('/') def index(): return render_template('index.html') @app.route('/customers') def customers(): conn = sqlite3.connect(db_name...
StarcoderdataPython
6554717
<reponame>nmjhsuzuki/DZICONV # coding: utf-8 # ========================================================== # dziconv # 入力画像群から Deep Zoom 形式画像ファイル(DZI) を生成する # ========================================================== # 2020-05-25 Ver.0.1 Initial Version. # ========================================================== # ...
StarcoderdataPython
12826778
<reponame>jordimarinvalle/tictactoexxl # -*- coding: utf-8 -*- import pytest from tictactoexxl.game import Game from tictactoexxl.board import Board from tictactoexxl.board import BoardPosition from tictactoexxl.player import Player class TestTicTacToeXXLGame(object): board = None player1 = None player...
StarcoderdataPython
1822618
<reponame>jiangxuewen16/hq-crawler import importlib import json from collections import namedtuple from types import FunctionType # from django.urls import re_path from django.urls import re_path from hq_crawler import settings from django.utils.autoreload import logger """ 注解路由核心类 """ class Route: routeViewP...
StarcoderdataPython
4932379
#!/usr/bin/env python3 import socket import math from gpiozero import PWMOutputDevice from gpiozero import DigitalOutputDevice HOST = '192.168.10.104' # Standard loopback interface address (localhost) PORT = 51717 # Port to listen on (non-privileged ports are > 1023) MAXDATAITEMS = 4 # Max number of items ...
StarcoderdataPython
344326
import numpy as np # Local Modules from constants import RAINBOW_WAVELENGHTS, SUNLIGHT from object import HollowSphere, Sphere from ray import Ray import utils EARTH_RADIUS = 6378 * 1000 DEFAULT_CENTER = np.array([0, -EARTH_RADIUS, 0]) DEFAULT_ATMOSPHERE_HEIGHT = EARTH_RADIUS * 0.025 DEFAULT_SUN_DIRECTION = utils.no...
StarcoderdataPython
8132914
from app.models import Category def test_id(): c = Category(name="Poom") print(c.get_id()) assert c.get_id() is None def test_name(): c = Category(name="Benz") print(c.get_name()) assert c.get_name()
StarcoderdataPython
1736167
#!/usr/bin/env python # Copyright 2014-2021 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
StarcoderdataPython
379860
from .client import * from . import charts from . import exceptions from . import resources
StarcoderdataPython
5100484
#from distutils.core import setup from setuptools import setup setup( name='responder', version='2.3.3.8', description='LLMNR/NBT-NS/mDNS Poisoner and NTLMv1/2 Relay', author='<NAME>', author_email='<EMAIL>', license='GPLv3', url='https://github.com/lgandx/Responder/', long_description=...
StarcoderdataPython
9663603
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # """ Tests for EditorSplitter class in editor.py """ # Standard library imports try: from unittest.mock import Mock import pathlib except ImportError: from mock import Mock # Python 2 im...
StarcoderdataPython
8088105
<filename>conformance/resources/swapi_create_subgraph.py import json import matplotlib.pyplot as plt import networkx as nx import os verts = {} with open("./swapi_vertices.json") as fh: for line in fh: line = json.loads(line) verts[line["gid"]] = line edges = {} with open("./swapi_edges.json") as...
StarcoderdataPython
6624826
# -*- coding: utf-8 -*- """ pygments.lexers.web ~~~~~~~~~~~~~~~~~~~ Lexers for web-related languages and markup. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import copy from pygments.lexer import RegexLexer, ExtendedReg...
StarcoderdataPython
11391173
<reponame>jhutchings1/pyright # This sample tests the type checker's handling of generic protocol types. from typing import TypeVar, Protocol T = TypeVar('T') T_co = TypeVar('T_co', covariant=True) T_contra = TypeVar('T_contra', contravariant=True) class Box(Protocol[T_co]): def content(self) -> T_co: .....
StarcoderdataPython
3352341
from . import flavors class InvalidUsage(Exception): status_code = 400 def __init__(self, message, status_code=None, payload=None): super().__init__() self.message = message if status_code is not None: self.status_code = status_code self.payload = payload def ...
StarcoderdataPython
4892023
<gh_stars>0 from rubygems_utils import RubyGemsTestUtils class RubyGemsTestrubygems_uuidtools(RubyGemsTestUtils): def test_gem_list_rubygems_uuidtools(self): self.gem_is_installed("uuidtools") def test_load_uuidtools(self): self.gem_is_loadable("uuidtools")
StarcoderdataPython
4901835
<reponame>TrabalhoAPC2021-02/Trabalho_Final<gh_stars>0 from click import style import dash import dash_core_components as dcc from dash import html from dash.dependencies import Output, Input import dash_bootstrap_components as dbc import plotly.graph_objects as go import plotly.express as px import pandas as pd impo...
StarcoderdataPython
4865095
from typing import List class Solution: def trap(self, bars: List[int]) -> int: if not bars or len(bars) < 3: return 0 volume = 0 left, right = 0, len(bars) - 1 l_max, r_max = bars[left], bars[right] while left < right: l_max, r_max = max(bars[left], l_max), max(...
StarcoderdataPython
6442836
# Natural Language Toolkit: An Crubadan N-grams Reader # # Copyright (C) 2001-2021 NLTK Project # Author: <NAME> <<EMAIL>> # # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ An NLTK interface for the n-gram statistics gathered from the corpora for each language using An Crubadan. There are mul...
StarcoderdataPython
11258066
<filename>httptest2/httptest2/testmodule/models.py<gh_stars>0 from __future__ import unicode_literals from django.db import models # Create your models here. class TestModule(models.Model): created = models.DateTimeField(auto_now_add=True) testmodule_id = models.IntegerField() status = models.BooleanFie...
StarcoderdataPython
8000435
import time import morpfw import pytest # lets setup a skeleton app class App(morpfw.BaseApp): pass class Root(object): pass @App.path(model=Root, path='') def get_root(request): return Root() # lets hook up some scheduled job # run this code every 5 seconds @App.periodic(name='myproject.every-5-s...
StarcoderdataPython
265940
<gh_stars>10-100 from six.moves import queue import gym import threading import uuid from typing import Optional from ray.rllib.utils.annotations import PublicAPI from ray.rllib.utils.typing import EnvActionType, EnvObsType, EnvInfoDict @PublicAPI class ExternalEnv(threading.Thread): """An environment that inter...
StarcoderdataPython
4900270
from collections import namedtuple from mock import patch import re import unittest from urllib import urlencode from wtforms.validators import ValidationError import pytest from fixtures import standard_graph, graph, users, groups, session, permissions # noqa from fixtures import fe_app as app # noqa from util imp...
StarcoderdataPython
8083586
PLUGINS = ["netbox_vault_secrets"] PLUGINS_CONFIG = { "netbox_vault_secrets": { "api_url": "http://localhost:8082/", "kv_mount_path": "/secret", "secret_path_prefix": "/netbox", "login_methods": ["token", "oidc"], "oidc": { "roles": { "demo": "Goo...
StarcoderdataPython
1941530
# -*- coding: utf-8 -*- import gzip import json import logging import multiprocessing import sys from datetime import datetime from os.path import basename, join import gensim from textlytics.sentiment.document_preprocessing import DocumentPreprocessor import spacy parser = spacy.load('en', parser=False, entity=Fal...
StarcoderdataPython
1723297
import pygame class Zombie(pygame.sprite.Sprite): def __init__(self, direction): # Call the parent class (Sprite) constructor super().__init__() self.image = pygame.Surface([4, 10]) if direction == 'left': self.image = pygame.image.load('zombie_right.png').convert_alpha(...
StarcoderdataPython
11222603
"""Coroutine of downloading media in parallel.""" import asyncio from asyncio import Semaphore from typing import Iterable, List, Optional import aiohttp from parallelmediadownloader.media_download_coroutine import DownloadOrder, MediaDownloadCoroutine from parallelmediadownloader.media_filter import MediaFilter from...
StarcoderdataPython
1799179
<reponame>NovaSBE-DSKC/predict-campaing-sucess-rate from dskc import exploration as dskc_exploration from dskc import clean as dskc_clean from dskc import modeling as dskc_modeling from dskc import _util as dskc_util from dskc.visualization import graphs as dskc_graphs from dskc.visualization import terminal as dskc_...
StarcoderdataPython
5057770
from __future__ import division, print_function # Multicut Pipeline implemented with luigi # Taksks for Feature Calculation import luigi from .customTargets import VolumeTarget from .dataTasks import InputData, StackedRegionAdjacencyGraph, ExternalSegmentation from .defectHandlingTasks import ModifiedAdjacency from ...
StarcoderdataPython
9737957
<reponame>vuiseng9/nncf_pytorch """ Copyright (c) 2022 Intel Corporation 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 appli...
StarcoderdataPython
3394136
from typing import Dict, Optional class MockTracerToInversion: def __init__( self, tracer, sparse_image_plane_grid_pg_list=None, profiling_dict: Optional[Dict] = None, ): self.tracer = tracer self.sparse_image_plane_grid_pg_list = sparse_image_pla...
StarcoderdataPython
5186221
<reponame>fcgtyg/SEAS # -*-coding:utf-8-*- import json import os import threading import subprocess32 as subprocess import sys from Password import Password from External_Functions.passwordGenerator import passwordGenerator from External_Functions.sendEmail import send_mail_password_reset from mysql.connector import ...
StarcoderdataPython
9731866
## 백트래킹 # 입력 N, M = map(int, input().split()) orders = [] for i in range(M): orders.append(0) # 백트랙킹 함수 def back(idx,order_list): ord_list = order_list[:] if(idx >= M): # 완성된 수열 출력 for i in range(M-1): print(ord_list[i],end = " ") print(ord_list[M-1]) else: s...
StarcoderdataPython
4995524
<reponame>VVKot/leetcode-solutions<filename>leetcode/python/1065_index_pairs_of_a_string.py """ T: O(N**3) S: O(N) -> does not consider output space We move through the text and collect prefixes that are present in words. When we seen an actual word, we add its position to the result. """ from typing import List cl...
StarcoderdataPython
9785533
"""Delete a block storage snapshot.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment @click.command() @click.argument('snapshot_id') @environment.pass_env def cli(env, snapshot_id): """Deletes a snapshot on a given volume""" block_manager =...
StarcoderdataPython
4929648
# coding=utf-8 """BERT finetuning runner.""" from __future__ import absolute_import, division, print_function import argparse import csv import logging import os import random import sys import codecs import json import numpy as np import torch from collections import defaultdict from torch.utils.data import (DataLo...
StarcoderdataPython
9773244
# Generated by Django 3.1.3 on 2020-11-19 14:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('akastories', '0002_auto_20201119_1303'), ] operations = [ migrations.AlterField( model_name='storyuser', name='usern...
StarcoderdataPython
3445065
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Train the disambiguator """ from quantulum3.classifier import train_classifier import argparse arguments = [ { 'dest': 'store', 'help': 'store resulting classifier in quantulum3 project folder', 'type': bool, 'default': True }, ...
StarcoderdataPython
1695659
from django.contrib.auth import get_user_model from django.db.models import fields from rest_framework import serializers from rest_framework.relations import StringRelatedField, SlugRelatedField from rest_framework.fields import CurrentUserDefault from users.models import Profile from polls.models import Poll, Quest...
StarcoderdataPython
48109
""" 爬取原网页的html,过滤新闻内容并重新拼接,保留原网页样式。 """ import pymysql import datetime import requests from lxml import etree import pdfkit import os import time import json import re # 敏感词过滤类,AC自动机 import Ac_auto # 任务id task_id = 2 # 爬取的地址和名称 spider_url = 'https://news.cqu.edu.cn/newsv2/' spider_name = '重大新闻网' # 爬虫程序爬取主页和首页的运行日期 ...
StarcoderdataPython
6401584
# Copyright 2021, <NAME> # # 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...
StarcoderdataPython
3262930
from __future__ import annotations import dataclasses import logging import os import sys import time from typing import TYPE_CHECKING, Dict, Iterator, List, Tuple import click if TYPE_CHECKING: import mypy_boto3_ec2.service_resource as ec2_resources from mypy_boto3_cloudwatch.client import CloudWatchClient ...
StarcoderdataPython
167941
<reponame>Staberinde/data-hub-api<gh_stars>1-10 from django_filters.rest_framework import DjangoFilterBackend from rest_framework.mixins import ListModelMixin from rest_framework.viewsets import GenericViewSet from config.settings.types import HawkScope from datahub.core.auth import PaaSIPAuthentication from datahub.c...
StarcoderdataPython
6620344
<gh_stars>0 # SRSI (Stochastic Relative Strength Index) # https://school.stockcharts.com/doku.php?id=technical_indicators:stochrsi # https://www.investopedia.com/terms/s/stochrsi.asp # StochRSI osilatörü, genelleştirilmiş bir fiyat değişikliği analizinden ziyade # belirli bir menkul kıymetin tarihsel performansı...
StarcoderdataPython
203543
import falcon import uuid try: import simplejson as json except ImportError: import json from didery.routing import * from didery.db.dbing import BaseSurveyDB, DB, DB_SURVEY_RESULTS_NAME def testSurveyPost(client): surveyResult = { "ip_address": "127.0.0.1" } response = client.simulate_...
StarcoderdataPython
1770792
<filename>rando/feedback/helpers.py<gh_stars>0 from rando import logger from rando.core.helpers import GeotrekClient def send_report(**data): record = dict( name=data['name'], email=data['email'], category=data['category'], comment=data['comment'], geom='' ) if dat...
StarcoderdataPython
3342774
#!/usr/bin/python """ xdomainserver.py -- a standalone (very) basic Python Web Server used to serve up the mod_pubsub web applications from a different port to the Python PubSub Server to support cross domain testing. It was built by extending the Python SimpleHTTPServer. It filters any html files...
StarcoderdataPython
9673270
<gh_stars>1-10 """The tests for the Buienradar sensor platform.""" from unittest.mock import patch from homeassistant.components.buienradar.const import DOMAIN from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE from tests.common import MockConfigEntry CONDITIONS = ["stationname", "temperature"] TEST_CFG_D...
StarcoderdataPython
9635205
""" Schema for config file """ CFG_SCHEMA = { 'main': { 'experiment_name_prefix': str, 'seed': int, 'num_workers': int, 'parallel': bool, 'gpus_to_use': str, 'trains': bool, 'image_shape': int, 'paths': { 'train': str, 'validat...
StarcoderdataPython
6400937
<reponame>curiousrohan1/stockbot from pandas_datareader import data as pdr from datetime import datetime import time import yfinance as yf import sqlite3 import configparser yf.pdr_override() # noinspection SpellCheckingInspection tickers = ['HTZ', 'LK', 'OAS', 'XSPA', 'VAL', 'VISL', 'GNUS', 'NE', 'FRSX', 'GCI', ...
StarcoderdataPython
3403246
<gh_stars>10-100 #!/usr/bin/python PLOTTER='matplotlib' #PLOTTER='gnuplot' COLORS = {"broken": "#FF3F3F", "good": "#7FFF7F", "---": "#CFCFCF", "test": "#FFFF7F", "missing1": "#FFFF7F", "missing2": "#FFFF7F", "failed": "#FF3F3F", "succeeded": "#7FFF...
StarcoderdataPython
6526073
def verifica(num): teste = [] cont = menor = maior = 0 for a in num.split(): teste.append(int(a)) for c in teste: if cont == 0: maior = c menor = c cont += 1 else: if maior < c: maior = c if menor > c: ...
StarcoderdataPython
8174574
import os from setuptools import setup, find_packages import versioneer install_requires = ["distributed", "requests", "cryptography"] setup( name="dask-saturn", version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), maintainer="Saturn Cloud Developers", maintainer_email="<EMAIL>"...
StarcoderdataPython
1834068
<reponame>heltonricardo/URI for g in range(int(input())): a, b = [int(x) for x in input().split()] s = 26**a * 10**b if a or b else 0 print(s)
StarcoderdataPython
6631892
<gh_stars>1-10 from ...exceptions import BadRequestException from ...utils import get_temp_dir from biosimulators_utils.combine.data_model import ( CombineArchive, CombineArchiveContent, ) from biosimulators_utils.combine.io import ( CombineArchiveWriter, ) from biosimulators_utils.sedml.data_model import (...
StarcoderdataPython
5010640
<filename>core/base_train.py import tensorflow as tf from misc.utils import Summarizer class BaseTrain: def __init__(self, sess, model, config, logger): self.model = model self.logger = logger self.summarizer = Summarizer(sess, config) self.config = config self.sess = sess ...
StarcoderdataPython
9656277
<filename>liBlog/visitor/admin.py<gh_stars>1-10 from django.contrib import admin from .models import Visitor, BannedIP, UntrackedUserAgent class VisitorAdmin(admin.ModelAdmin): search_fields = ['ip_address', 'user_agent', 'url'] list_display = ['ip_address', 'user', 'user_agent', 'url', 'page_views', ...
StarcoderdataPython
12835290
from django.urls import path from django.conf.urls import url from django.urls import include from api.seq import views urlpatterns = [ path('chipseq/', include('api.seq.chipseq.urls')), path('counts', views.counts, name='counts'), path('mapped', views.mapped, name='mapped'), path('type', views.data_t...
StarcoderdataPython
5106170
<gh_stars>0 # <NAME> U Department of Astronomy and Astrophysics NYC 2016 # <EMAIL> #--[DESCRIPTION]---------------------------------------------------------# ''' Date: May 2016 Handeler for twitter json text ''' #--[PROGRAM-OPTIONS]------------------------------------------------------# import json import nltk imp...
StarcoderdataPython
1787738
import socket import msvcrt sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('127.0.0.1',20002)) while True: data, addr = sock.recvfrom(1024) print(data.decode()) sock.close()
StarcoderdataPython
9634311
<filename>app/barometer/migrations/0001_initial.py # Generated by Django 3.1.4 on 2020-12-06 15:00 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Barometer', ...
StarcoderdataPython
357689
class Struct(object): def __init__(self, data=None, **kwds): if not data: data = {} for name, value in data.items(): if name: setattr(self, name, self._wrap(value)) for name, value in kwds.items(): if name: setattr(self, nam...
StarcoderdataPython