text
string
size
int64
token_count
int64
# Copyright (c) Facebook, Inc. and its affiliates. import collections import json import logging import os import sys from typing import Type from mmf.utils.configuration import get_mmf_env from mmf.utils.distributed import is_master from mmf.utils.file_io import PathManager from mmf.utils.timer import Timer class ...
7,179
2,119
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns from .provider import HubicProvider urlpatterns = default_urlpatterns(HubicProvider)
163
47
class MexFinder: """This class collects non-negative integers, and finds the minimal non-negative integer that was not added to it. """ def __init__(self): # We maintain a dict, representing a set, with the following # invariants: # (a) Its keys are the elements of the set (and -...
1,710
500
from collections import namedtuple from pytest import fixture from geocoder.geocoding import ( Addresses, Coordinates, ) @fixture def mock_csv_coordinates(tmp_path): data = [ "city,street,number,postal_code,state,lon,lat", "Katowice,Armii Krajowej,102,40-671,istniejacy,259921.7313,498200....
1,672
656
from django.http import HttpRequest from django.views import generic from django.shortcuts import render, reverse, get_object_or_404, HttpResponseRedirect from django.db.utils import IntegrityError from .models import User, UserType, Goods from .forms import (RegisterFEForm, RegisterBEForm, LoginFEForm, LoginBEForm, C...
15,949
5,294
import os import json import stat from pathlib import Path import sys import urllib.parse import uuid import shutil os.chdir(os.path.dirname(os.path.abspath(__file__))) j = '' with open('update_config.json') as f: j = f.read() j = json.loads(j) branch_db = j["branch_db"] branch_runtime = j["branch_runtime"] bran...
7,176
2,710
from Configuration.PyReleaseValidation.relval_steps import Matrix, InputInfo, Steps import os import json import collections workflows = Matrix() steps = Steps() def get_json_files(): cwd = os.path.join(os.getcwd(), "json_data") if not os.path.exists(cwd): return [] json_files = [] for f i...
2,922
837
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed i...
2,260
701
# Copyright 2015 Oliver Cope # # 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, ...
15,579
5,181
from .drug_central import DrugCentralTransform __all__ = [ "DrugCentralTransform" ]
88
31
from pathlib import Path from aiogram_oop_framework.core.funcs import get_init_py class ProjectStructure: def __init__(self, project: 'Project'): self.root: Path = project.path / project.name self.directories = {'root': {'directory': self.root, 'tree': {}}} def add_dir_to_root(self, name: st...
2,613
741
#!/usr/bin/python # -*- coding:utf-8 -*- import os from bs4 import BeautifulSoup class Analyzer(object): def __init__(self): pass @staticmethod def get_page_count(html): soup = BeautifulSoup(html, 'html.parser') # <span style="color:#65645F;">共75661篇</span> ...
7,666
2,596
#Classifier 1------------------------------------------------------------- # author: Arun Ponnusamy # website: https://www.arunponnusamy.com # import necessary packages from keras.preprocessing.image import img_to_array from keras.models import load_model import numpy as np import cv2 import cvlib as cv class Gend...
3,149
1,195
__author__ = ['djjensen', 'jwely'] __all__ = ["_extract_HDF_layer_data"] import gdal import os def _extract_HDF_layer_data(hdfpath, layer_indexs = None): """ Extracts one or more layers from an HDF file and returns a dictionary with all the data available in the HDF layer for use in further format conver...
3,389
1,301
import torch from torch import nn from torchvision.models.video.resnet import VideoResNet, BasicBlock, Conv2Plus1D, R2Plus1dStem model_urls = { "r2plus1d_34_8_ig65m": "https://github.com/moabitcoin/ig65m-pytorch/releases/download/v1.0.0/r2plus1d_34_clip8_ig65m_from_scratch-9bae36ae.pth", # noqa: E501 ...
1,964
874
#!/usr/bin/python import datetime from .geo import utc_to_localtime import gpxpy import pynmea2 """ Methods for parsing gps data from various file format e.g. GPX, NMEA, SRT. """ def get_lat_lon_time_from_gpx(gpx_file, local_time=True): """ Read location and time stamps from a track in a GPX file. Re...
2,213
726
import logging import time import inflection from .events import Event, RedisEvent logger = logging.getLogger(__name__) class EventConsumer(object): def __init__(self, streams, group, consumer_name, db, consume_from_end=False): """ An event consumer :param streams: List of stream names ...
1,685
477
#!/usr/bin/env python3 def check(lst, k): d = set() for n in lst: if k - n in d: return True d.add(n) return False print(check([10, 15, 3, 7], 17)) print(check([10, 15, 3, 7], 11))
222
101
# -*- coding: utf-8 -*- # This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delet...
10,124
3,323
import os from xlrd import open_workbook import pandas as pd from grimsel_h.auxiliary.aux_general import print_full, expand_rows, read_xlsx_table def get_chp_profiles(target_dir=None): print('Directory get_chp_profiles:', os.getcwd()) fn = 'heat_demand_profiles_20170614.xlsx' dct = '../.....
1,845
741
import csv import re import collections from tts.text_processor import RESOURCE_PATH class GetStringType(object): """ Get String type if it is Date, Time, Number Number formats which are handled are below 1. Date (12.12.12 or 12/12/12 or 12-12-12) 2. Time (12:12:12 or 12:12) 3....
3,438
1,103
from .simclr import TransformsSimCLR
37
13
from setuptools import setup setup( name="example", version="0.1", author="mulh8377", )
100
38
import pytest import numpy as np # type: ignore from uniplot.param_initializer import validate_and_transform_options from uniplot.multi_series import MultiSeries def test_passing_simple_list(): series = MultiSeries(ys=[1, 2, 3]) options = validate_and_transform_options(series=series) assert options.inte...
1,029
354
#!/Python27/python from ..database.database import Database # A class used for song insertion class Song: def __init__(self, title, production_year, cd, singer, composer, song_writer): self.title = title self.production_year = production_year self.cd = cd self.singer = singer ...
2,055
527
import h5py as hp import numpy as np import re def h5_io(filename, spike_to_load, analog_to_load): spikes = dict() analogs = dict() events = dict() comments = dict() with hp.File(filename,'r') as f: for key in f.keys(): if key=='events': events['times'] = f[key]['...
1,237
362
from src.folder_0.file_0 import func_sum def func_sum_product(a,b,c,d): e = func_sum(a, b) f = func_sum(c, d) return e * f
142
67
import time import network_manager from components import Heartbeat, LogManager from message_bus import MessageBus import logger class Gateway: def __init__(self): self._message_bus = MessageBus(self._on_message) self._components = [] self._component_dict = {} def add_component(self...
1,601
427
import os from functools import partial import numpy as np from ding.envs import SyncSubprocessEnvManager from ding.utils.default_helper import deep_merge_dicts from easydict import EasyDict from tqdm import tqdm from haco.DIDrive_core.data import CarlaBenchmarkCollector, BenchmarkDatasetSaver from haco.DIDrive_core....
3,439
1,157
#!/usr/bin/env python #https://github.com/kislyuk/argcomplete#synopsis import argcomplete import argparse import hashlib import json import os import re import socket import sqlite3 import sys import time from pathlib import Path from tabulate import tabulate from datetime import datetime # pip install python-dateutil...
25,206
7,751
# -*- coding: utf-8 -*- # Copyright 2019, Sprout Development Team # Distributed under the terms of the Apache License 2.0 import hashlib import secrets import string import base64 import hmac _allowed = (string.digits + string.ascii_lowercase + string.ascii_uppercase) def get_random_str(): ...
2,381
754
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 """ __init__ for adf-build """
139
58
# 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! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
13,959
3,992
# -*- coding: utf-8 -*- """ Created on Mon May 10 04:24:41 2021 @author: Saif """ import numpy as np from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D, GlobalAveragePooling2D from keras.layers import Dropout, Flatten, Dense from keras.preprocessing import image ...
2,499
962
# -*- coding: utf-8 -*- """Test functions that get data.""" import os import unittest from bio2bel_uniprot import get_mappings_df HERE = os.path.abspath(os.path.dirname(__file__)) URL = os.path.join(HERE, 'test.tsv') class TestGet(unittest.TestCase): """Test getting data.""" def test_get_mappings(self): ...
452
164
import re import pytest from alfasim_sdk._internal.types import MultipleReference from alfasim_sdk._internal.types import Reference @pytest.mark.parametrize("expression_type", ["enable_expr", "visible_expr"]) def test_enable_expr_and_visible_expr(expression_type): from alfasim_sdk._internal.types import String ...
6,520
2,043
import unittest import numpy as np from scipy.integrate import cumulative_trapezoid from numpy.testing import assert_array_equal from math_signals.math_relation import Relation from math_signals.defaults.base_structures import BaseXY def pre_integr(x, y): return BaseXY(x=x[1:], y=np.ones(x[1:].size)) ...
6,153
2,554
from copy import deepcopy from nglp.lib.seamless import Construct, SeamlessException class OpenAPISupport(object): DEFAULT_OPENAPI_TRANS = { # The default translation from our coerce to openapi is {"type": "string"} # if there is no matching entry in the trans dict here. "unicode": {"type...
4,910
1,406
from bot.DataBase.Logic import Page, MainText def run_migrate(): Page.migrate() MainText.migrate()
110
41
#!/usr/bin/env python # # Copyright (c) 2018 Cisco and/or its affiliates # import sys import requests from argparse import ArgumentParser from requests.auth import HTTPBasicAuth def send_request(protocol, host, port, username, password): '''Generate a simple RESTCONF request. ''' # url = "{}://{}:{}/restc...
1,919
572
def even_odd(A): pe, po = 0, len(A) - 1 while pe < po: if A[pe] % 2 == 0: pe += 1 else: # if it pe hits an odd, swap with the one at po. if this po bears 1) an even value, next round pe will move right and therefore skip to the next. 2) an odd value, then next round it wi...
584
217
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
4,072
1,222
""" Base model class for User """ class UserModel(): def __init__(self, name:str, roles:list): """ Creates a user with given name and role :param name : name as string is the user name :param role : role as list of role """ self.__name = name self.__roles = r...
450
124
import pygame, random from pygame.locals import * SCREEN_WIDTH = 400 SCREEN_HEIGTH = 800 SPEED = 10 GRAVITY = 1 GAME_SPEED = 10 X = 0 Y = 1 GROUND_WIDTH = 2 * SCREEN_WIDTH GROUND_HEIGHT = 100 PIPE_WIDTH = 80 PIPE_HEIGHT = 500 PIPE_GAP = 200 class Bird(pygame.sprite.Sprite): def __init__(self): pygame....
4,975
1,833
import pandas as pd import numpy as np from sklearn.datasets.base import Bunch import os import pickle from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.cross_validation import train_test_split import random from collections import defaultdict from sklearn.linear_model import LogisticRegressionCV...
2,487
840
""" Support for Wink sensors. For more details about this platform, please refer to the documentation at at https://home-assistant.io/components/sensor.wink/ """ import logging from homeassistant.const import TEMP_CELSIUS from homeassistant.helpers.entity import Entity from homeassistant.components.wink import WinkDe...
3,136
978
""" TencentBlueKing is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaSCommunity Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the...
2,925
1,072
#!/usr/bin/env python # # Copyright (c) 2016-2018 Nicholas Corgan (n.corgan@gmail.com) # # Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt # or copy at http://opensource.org/licenses/MIT) # import pkmn import os import sys import unittest class database_entry_test(unittest.TestCase): ...
7,552
2,621
import logging from .node import Node from .events import NodeConnectedEvent, NodeDisconnectedEvent log = logging.getLogger('lavalink') class NodeManager: def __init__(self, lavalink, regions: dict): self._lavalink = lavalink self.nodes = [] self.regions = regions or { 'asia'...
4,303
1,228
import json import pytest from oandaV20helper.endpoints.pricing import to_dom class TestPricing: @pytest.mark.parametrize("num, filename", [ (1, 'test_pricing01.json'), (3, 'test_pricing02.json'), (15, 'test_pricing03.json') ]) def test_to_dataframe(self, num, filename): ...
518
192
import logging from pathlib import Path from utsc.core import Util class PropogateHandler(logging.Handler): def emit(self, record): logging.getLogger(record.name).handle(record) class MockFolders: class ConfDir: def __init__(self, path: Path, app_name: str) -> None: self.dir = pa...
2,364
796
import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import number from esphome.const import ( CONF_ADDRESS, CONF_ID, CONF_MAX_VALUE, CONF_MIN_VALUE, CONF_MULTIPLY, CONF_STEP, ) from .. import ( MODBUS_WRITE_REGISTER_TYPE, add_modbus_base_propertie...
3,889
1,431
#!/usr/bin/env python import sys try: file = open("log.txt","r") except OSError: pass i=0 for line in file: i+=1 if line.find("CROSSOVER ")!=-1: array = line.split(" ") if (float(array[3]) < float(array[1])) and (float(array[3]) < float(array[2])): print(line)
306
116
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # 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...
3,827
1,150
# USDA_CoA_Cropland.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 import json import numpy as np import pandas as pd from flowsa.common import * def CoA_Cropland_URL_helper(build_url, config, args): """This helper function uses the "build_url" input from flowbyactivity.py, which is a base url for coa cropla...
9,305
3,128
from django.db import IntegrityError from rest_framework.authentication import TokenAuthentication, SessionAuthentication from rest_framework.response import Response import django.shortcuts as shortcuts from rest_framework import ( status, viewsets, serializers as drf_serializers, permissions as drf_pe...
4,762
1,351
#!/usr/bin/python import socket import sys import os #grab the banner def grab_banner(ip_address,port): try: s=socket.socket() s.connect((ip_address,port)) banner = s.recv(1024) print ip_address + ':' + banner except: return def checkVulns(banner): if len(sys.argv) >=...
804
279
# Simple character prediction model (stateful) model = keras.models.Sequential([ keras.layers.GRU(128, return_sequences=True, stateful=True, dropout=0.2, recurrent_dropout=0.2, batch_input_shape=[batch_size, None, max_id]), keras.layers.GRU(128, return_sequences=True, stateful=True, ...
478
223
import os from xml.etree import ElementTree from scipy.spatial import distance as dist import numpy as np from time import sleep import cv2 from PIL import Image, ImageDraw import colorsys def order_points(ptsArr): # pt_a, pt_b: out of the 2 left X, a is thr top one and b is the bottom. # pt_c, pt_d: out of ...
12,681
4,121
def translate_date(date:str): split_date = date.split(".") modified_date = split_date[2]+"-"+split_date[1]+"-"+split_date[0] return modified_date print(translate_date("19.05.2021"))
194
76
from django.conf import settings def act_theme(request): return {'ACT_THEME': getattr(request, 'ACT_THEME', settings.THEME)}
129
41
# Copyright (c) 2006-2007 Open Source Applications Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
3,839
1,022
##### # # Module name: dremail.com # Purpose: Manage email connections for dupReport # # Notes: # ##### # Import system modules import imaplib import poplib import email import quopri import base64 import re import datetime import time import smtplib import os from email.mime.multipart import MIMEMultipart from...
38,975
11,015
# Copyright 2016 Brocade Communications Systems Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
4,557
1,362
from PyQt4 import QtCore, QtGui class UiWorld(QtGui.QWidget): """Qt widget representing the world """ def __init__(self, parent): super(UiWorld, self).__init__(parent) self.__last_point = None self.image = QtGui.QImage(800, 600, QtGui.QImage.Format_ARGB32) self.image.fill(Qt...
2,373
814
# -*- encoding: utf8 -*- import logging import re import socket import subprocess __all__ = [ 'RFComm' ] class RFCommNotConnected(BaseException) : pass class RFCommError(BaseException) : pass class RFComm : def __init__(self, bdaddr, port, timeout=5, encoding='utf-8') : self.logger = logging.g...
7,215
2,810
from dateutil import parser from dateutil import relativedelta, tz from calendar import monthrange from six import text_type, binary_type, integer_types import datetime import string import collections import time '''Modified _ymd object that support format detection''' class _format_ymd(list): def __init__(self...
27,203
7,721
from vtk import vtkSplineWidget, vtkLineSource, vtkActor, vtkPolyDataMapper from numpy import linspace from math import pi, asin, sqrt, sin from scipy import interpolate import numpy as np # CODE REGIONS: # 1) Spline computing # 2) Spline redrawing # 3) Setters # 4) Getters # 5) Coordinates transformation # 6) Handle...
10,517
3,455
from ._vault import Vault from ._vault import vault from .exceptions import SecretMissingError from .exceptions import CastError from .exceptions import CastHandlerMissingError from .secret_sources import FileSecretSource from .secret_sources import EnvironmentVariableSecretSource from .preprocessors import base64prepr...
679
195
#!/usr/bin/env python2 from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter as ADHF import sys import csv def readHomologyFromEnsemble(data): res = list() isHeader = True for line in csv.reader(data, delimiter=','): if isHeader: isHeader = False continue ...
1,054
332
#!/usr/bin/env python """warcextract - dump warc record context to directory""" import os import sys import os.path import uuid import mimetypes import shlex from optparse import OptionParser from contextlib import closing from urlparse import urlparse from hanzo.warctools import ArchiveRecord, WarcRecord from hanz...
7,534
2,282
from .. import NextGenInstanceResource, NextGenListResource class Reservation(NextGenInstanceResource): """ A Reservation resource. See the `TaskRouter API reference <https://www.twilio.com/docs/taskrouter/tasks#reservation>_` for more information. .. attribute:: sid The unique ID o...
3,017
729
"""This script creates the patched dataset""" import sys import glob import json from tqdm import tqdm import numpy as np from PIL import Image import multiprocessing from datetime import datetime from joblib import Parallel, delayed from scipy.interpolate import interp1d from scipy.ndimage import generic_filter from ...
12,537
3,945
"""Implements a non-blocking pipe class.""" # Since it uses thread rather than select, it is portable to at least # posix and windows environments. # Author: Rasjid Wilcox, copyright (c) 2002 # Ideas taken from the Python 2.2 telnetlib.py library. # # Last modified: 3 August 2002 # Licence: Python 2.2 Style ...
4,677
1,396
import copy import json import logging from iptv_proxy.providers import ProvidersController from iptv_proxy.security import SecurityManager logger = logging.getLogger(__name__) class ProviderConfiguration(object): __slots__ = [] _configuration_schema = {} _provider_name = None @classmethod def...
61,165
14,197
# um programa que pega a ºC, e transforma em Fº c = float(input('informe a temperatura: ')) f = ((9*c)/5)+32 print('A temperatura {}ºc, corresponde à {}ºf'.format(c,f))
173
76
set_name(0x80123B68, "EA_cd_seek", SN_NOWARN) set_name(0x80123B70, "MY_CdGetSector", SN_NOWARN) set_name(0x80123BA4, "init_cdstream", SN_NOWARN) set_name(0x80123BB4, "flush_cdstream", SN_NOWARN) set_name(0x80123BD8, "check_complete_frame", SN_NOWARN) set_name(0x80123C58, "reset_cdstream", SN_NOWARN) set_name(0x80123C80...
2,927
1,691
import luigi from luigi.contrib.hdfs import HdfsTarget class ImpcConfig(luigi.Config): dcc_xml_path = luigi.Parameter(default="./") output_path = luigi.Parameter(default="./") deploy_mode = luigi.Parameter(default="client") def get_target(self, path): return ( luigi.LocalTarget(pa...
423
132
from django.contrib import admin from .models import News, Subscriber @admin.register(News) class NewsAdmin(admin.ModelAdmin): list_display = ["subject", "key_identifier", "dispatch_date", "modified", "created"] search_fields = ["subject", "message"] @admin.register(Subscriber) class SubscriberAdmin(admin....
468
145
import unittest from nose2.tools import params import sys import datetime sys.path.append("../") from repgen.data import Value from repgen.util import TZ def test_gents_scalar(): t_end = datetime.datetime.now().replace(minute=0,second=0,microsecond=0,tzinfo=TZ("UTC")) t_start = t_end-datetime.timedelta(hours...
1,258
506
#!/usr/bin/env python # coding: utf-8 # ### Author : Sanjoy Biswas # ### Topic : Mall Customer Segmentation & Analysis # ### Email : sanjoy.eee32@gmail.com # # **Data Import And Preprocessing** # In[1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from plotly.offlin...
9,096
2,910
#!/usr/bin/env python3 # This file is Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr> # License: BSD # Disclaimer: This SoC is still a Proof of Concept with large timings violations on the IP/UDP and # Etherbone stack that need to be optimized. It was initially just used to validate the reversed # pin...
4,319
1,455
from time import sleep import threading import stepper import RPi.GPIO as GPIO motor1Pins = [7, 8, 9, 10] motor2Pins = [17, 18, 22, 23] def moveMotor(pins, degrees): sleep(1) GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) motor = stepper.Motor(pins) motor.rpm = 15 motor.moveTo(degrees) motor1...
508
230
# coding=utf-8 import git from os.path import expanduser from mock import patch, MagicMock from jig.tests.testcase import CommandTestCase, result_with_hint from jig.commands import sticky from jig.exc import ( ForcedExit, JigUserDirectoryError, GitConfigError, InitTemplateDirAlreadySet, GitTemplatesMissing, Gi...
4,109
1,201
import numpy as np import torch import torch.nn as nn import pdb def get_model(args, pretrain=False): if args.dimension == '2d': if args.model == 'unet': from .dim2 import UNet if pretrain: raise ValueError('No pretrain model available') return UNet(...
5,624
1,784
from django.contrib.auth import get_user_model from django.test import Client, TestCase # Client: test request in the application for unit test from django.urls import reverse # generate urls for django admin page from django.utils.translation import gettext as _ class AdminSiteTests(TestCase): """Contains unit...
1,925
586
import json import re import requests import unidecode import urllib.parse def normalize_lemma(lemma): return re.sub(r'[^a-z]', '', unidecode.unidecode(lemma)) def get_existing_entries(user_agent): url = 'https://query.wikidata.org/sparql?{}'.format(urllib.parse.urlencode({'query': 'SELECT DISTINCT (REPLACE...
8,731
2,871
import pytest from math import isclose import sys sys.path.append('/Users/pyann/Dropbox (CEDIA)/srd/Model') import srd from srd import quebec qc_form = quebec.form(2016) @pytest.mark.parametrize('income, amount', [(0, 966), (33e3, 966), (51e3, 0), (34e3+(51e3-34...
1,591
736
from flask import Flask, render_template from firestore_utilities import get_medium, db, get_github_events, get_projects application = Flask(__name__) @application.route("/") def root(): return render_template("root.html") @application.route("/blog") def blog(): blog_list = get_medium(db) return rende...
952
296
# coding=utf-8 import os, re, sys, clr, json, math, logging, random, time from itertools import combinations os.chdir(os.path.dirname(__file__)) logging.basicConfig(filename='gui.log', filemode='w', encoding='utf-8', level=logging.DEBUG) clr.AddReference('System.Drawing') clr.AddReference('System.Windows.Forms') ...
49,754
16,913
from time import sleep from selenium import webdriver from secrets import password from selenium.webdriver.common.keys import Keys from time import sleep, strftime chromedriver_path ='/mnt/c/Users/louis/Documents/GitHub/instagram_bot/chromedriver.exe' class Instabot: def __init__(self, username, password):...
750
235
# -*- coding: utf-8 -*- from typing import List from nodedge.blocks.block import Block from nodedge.blocks.block_config import BLOCKS_ICONS_PATH, OP_NODE_INPUT, registerNode from nodedge.blocks.graphics_block import GraphicsBlock from nodedge.blocks.graphics_input_block_content import GraphicsInputBlockContent from no...
1,738
518
import pandas as pd class Core: def __init__(self, players): index_with_nan = players.index[players.isnull().any(axis=1)] players.drop(index_with_nan,0, inplace=True) self.Players = players def roi_top_players(self): ''' Sorted the player list by ROI from the top ...
5,890
1,675
import cv2 import numpy as np from sklearn import svm from sklearn.externals import joblib from main import data_set as ds from main import feature_program as fp from util import save_2_db as db from util import file_manage as fm # 训练分类器 def train_classifier(feature_type): train_data = np.float32([]).reshape(0, 50...
3,799
1,381
from .konlpy_set import KinQueryDatasetVer2, preprocess, get_embedding_dim
75
27
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) a = [ x for x in y ]
102
39
"""momoichigo views.""" from __future__ import annotations import io import logging from typing import Any, List, Tuple from urllib.parse import urlparse import pendulum import requests from django.core.exceptions import ValidationError from django.db import transaction from rest_framework import mixins, status, view...
4,616
1,421
#!/usr/bin/env python __author__ = "Richard Clubb" __copyrights__ = "Copyright 2018, the python-uds project" __credits__ = ["Richard Clubb"] __license__ = "MIT" __maintainer__ = "Richard Clubb" __email__ = "richard.clubb@embeduk.com" __status__ = "Development" from abc import ABCMeta, abstractmethod class iContain...
993
286
#variables media = 0 maior = 0 menor = 9999 #input + process for(i) in range(1, 11): N = int(input("Digite um número: ")) if(N > maior): maior = N if(N < menor): menor = N media = (media + (N / 10)) print("Maior número: {0}".format(maior)) print("Menor número: {0}".format(menor)) print(...
347
143
import yaml import torch import argparse from torch.utils import data from tqdm import tqdm from ptsemseg.models import get_model from ptsemseg.loader import get_loader from ptsemseg.metrics import runningScoreDepth, averageMeter def count_parameters(model): return sum(p.numel() for p in model.parameters() if p...
2,464
805