text string | size int64 | token_count int64 |
|---|---|---|
# coding: utf-8
"""
Mux API
Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501
The version of the OpenAPI document: v1
Contact: devex@mux.com
Gener... | 6,016 | 1,777 |
import cv2
import numpy as np
import sys
from utils import *
def logsawtooth(x: float) -> float:
return (x+1)/(2**np.floor(np.log2(x+1))) - 1.
class LogLogImagePattern(ImageSurface):
def __init__(self, img: np.array):
super().__init__(img)
self.domain = SurfaceDomain(-1, -1, 15, 15, False, Fa... | 1,816 | 701 |
import json
import os
import inspect
import api_builder
import time
EXECUTABLE_NAME = 'api_builder'
APPLICATION_DESCRIPTION = '''
This is a CLI to build, package, and release AWS APIs using API Gateway and Lambda.
'''
ZLAB_CONF_FILE = "zlab-conf.json"
STATIC_DIR = os.path.join(os.path.dirname(inspect.getfile(api_build... | 1,042 | 385 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ykdl.util.html import get_content
from ykdl.util.match import match1
from ykdl.extractor import VideoExtractor
from ykdl.videoinfo import VideoInfo
import json
from random import randint
class Laifeng(VideoExtractor):
name = u'laifeng (来疯直播)'
def prepare(se... | 1,280 | 471 |
# Copyright (c) 2014-2019. Mount Sinai School of Medicine
#
# 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 applicabl... | 5,047 | 1,418 |
LR = 1e-4
NUM_ITER = 1
| 23 | 18 |
# Generated by Django 2.1.7 on 2019-03-17 17:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userDB', '0011_auto_20180318_1739'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='member',
... | 424 | 150 |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Zhipeng Zhang (zhangzhipeng2017@ia.ac.cn)
# ------------------------------------------------------------------------------
import _init_paths
import os
import shutil
... | 9,399 | 3,183 |
import sys
import copy
from pathlib import Path
import fnmatch
import numpy as np
from scipy.interpolate import interp1d, interp2d
import matplotlib.dates as mdates
from matplotlib.offsetbox import AnchoredText
import gsw
from netCDF4 import Dataset
from .. import io
from .. import interp
from .. import unit
from .... | 49,876 | 17,650 |
def make_get_toks(f=None):
"make iterator and next functions out of iterable of split strings"
from sys import stdin
from itertools import chain
def sp(ln):
"to split the strings with a map"
return ln.split()
def the_it():
"so that both results are callable in similar man... | 624 | 229 |
import random
from rltools.strategies import Strategy
class EpsilonGreedyStrategy(Strategy):
'''
Very simple strategy in which the best action is chosen by a greedy policy with probability of
`(1 - epsilon)` times and a random action is chosen with probability `epsilon` times. Epsilon
is gradually dec... | 1,030 | 294 |
# Generated by Django 2.1.5 on 2019-01-27 11:49
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 2,625 | 771 |
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import numpy as np
import pandas as pd
import re
from collections import Counter
import extraction
import model
plt.rcParams["font.family"] = "serif"
def get_amins_plot(frame_grouped, nawba, nawba_centones):
"""
Plot distribution from <frame... | 8,877 | 3,278 |
def synonym_queries(synonym_words, queries):
'''
synonym_words: iterable of pairs of strings representing synonymous words
queries: iterable of pairs of strings representing queries to be tested for
synonymous-ness
'''
synonyms = defaultdict(set)
for w1, w2 in synonym_words:
... | 770 | 266 |
# -*- coding: utf-8 -*-
u"""test missing cookies
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
def test_srw_missing_cookies(fc):
from pykern.pkunit im... | 531 | 200 |
spam = """The Project Gutenberg EBook of Romeo and Juliet, by William Shakespeare
This eBook is for the use of anyone anywhere at no cost and with
almost no restrictions whatsoever. You may copy it, give it away or
re-use it under the terms of the Project Gutenberg License included
with this eBook or online at www.gu... | 174,160 | 53,682 |
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from ...sell_analytics.api.customer_service_metric_api import CustomerServiceMetricApi
from ...sell_analytics.api.seller_standards_profile_api import SellerStandardsProfileApi
from ...sell_analytics.api.traffic_report_api import Traf... | 333 | 102 |
from nxneo4j.base_graph import BaseGraph
class Graph(BaseGraph):
def __init__(self, driver, config=None):
super().__init__(driver, "UNDIRECTED", config)
| 167 | 55 |
from django.contrib.auth import authenticate, login
def LogIn(request, username, password):
user = authenticate(username=username, password=password)
if user is not None:
if user.is_active:
login(request, user) | 245 | 69 |
import random
def rock_paper_scissors():
player = input("Choose 'r' for rock, 'p' for paper, or 's' for scissors: ")
choices = ['r', 'p', 's']
opponent = random.choice(choices)
if player == opponent:
return print(f"It's a tie! You both selected {player}")
if winner(player, opponent):
... | 671 | 231 |
import re
from random import randint
from typing import Match
from typing import Optional
from retrying import retry
from apysc._display.line_dash_setting import LineDashSetting
from apysc._display.line_dash_setting_interface import LineDashSettingInterface
from apysc._expression import expression_data_util
... | 5,974 | 1,824 |
"""
File: anagram.py
Name: Diana Pei-Rung Yu
----------------------------------
This program recursively finds all the anagram(s)
for the word input by user and terminates when the
input string matches the EXIT constant defined
at line 19
If you correctly implement this program, you should see the
number of anagrams f... | 5,009 | 1,370 |
#Handles basic YAML configuration file including setting defaults
import yaml
class Config:
settings = {}
def setDefaults(self, setting, defaults):
#Apply some reasonable defaults which do not have parameters set
if setting in self.settings:
for config in self.settings[setting].values():
for... | 1,199 | 334 |
from exc.test_failed import TestFailed
from conf import hook
""" Post-Test Hook: ExpectedRetCode
This is a post-test hook which checks if the exit code of the Wget instance
under test is the same as that expected. As a result, this is a very important
post test hook which is checked in all the tests.
Returns a TestFai... | 1,043 | 288 |
# API: The Met
# No key required
import requests
# r = requests.get('https://collectionapi.metmuseum.org')
# print('The request code was:',r.status_code)
# print('Here is the text of the webpage:',r.text)
# Finding object ID using the search
# r = requests.get('https://collectionapi.metmuseum.org/public/collection/v... | 661 | 219 |
from .hpfspec import *
| 23 | 9 |
import re
import os
from mmcv.runner.hooks.logger.base import LoggerHook
from mmcv.runner import master_only
from mmdet.core.utils import logger
class CheckpointHook(LoggerHook):
def __init__(self,
save_every_n_steps,
max_to_keep=2,
keep_every_n_epochs=50,
... | 3,339 | 1,050 |
import pandas as pd
from pathlib import import Path
def parse_biosample(biosample):
fields = {}
with biosample.open('r') as f:
for line in f:
l = line.strip()
if l.startswith('/'):
k, v = l.lstrip('/').split('=')
fields[k] = v
return fiel... | 532 | 191 |
"""
Element
~~~~~~~~
:author: Lingyun Yang
:date: 2011-05-13 10:28
"""
import re
import copy
import logging
# from unitconv import *
# public symbols
__all__ = [ "merge", "ASCENDING", "DESCENDING", "UNSPECIFIED" ]
_logger = logging.getLogger(__name__)
# flags bit pattern
_DISABLED = 0x01
_READONLY = 0x02
UNSPECIF... | 39,455 | 12,137 |
import sys
import math
import numpy as np
#from sklearn.cluster import KMeans
import cv2
from scipy import ndimage
def mse(imageA, imageB):
# the 'Mean Squared Error' between the two images is the
# sum of the squared difference between the two images;
# NOTE: the two images must have the same dimension
err = n... | 3,406 | 1,541 |
from typing import Tuple, List, Union
import numpy as np
from common.exceptionmanager import catch_error_exception
from common.functionutil import ImagesUtil
from imageoperators.boundingboxes import BoundingBoxes, BoundBox3DType, BoundBox2DType
from preprocessing.imagegenerator import ImageGenerator
TYPES_FILTERING_... | 22,663 | 7,542 |
"""
List
====
See: https://www.carbondesignsystem.com/components/list/usage/
Lists are vertical groupings of related content. List items begin with either
a number or a bullet.
Overview
--------
Lists consist of related content grouped together and organized vertically.
Use bulleted lists when you don’t need to co... | 1,950 | 578 |
"""
Models an output port on a switch with a given rate and buffer size (in either bytes
or the number of packets), using the Early Random Detection (RED) mechanism to drop packets.
"""
import random
from ns.port.port import Port
class REDPort(Port):
""" Models an output port on a switch with a given rate and bu... | 4,536 | 1,184 |
from image import image_to_binary
from sender import modulate
img = image_to_binary("app")
print(img)
| 103 | 33 |
'''
You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1].
We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating them, the result should equal the sorted array.
Return the largest number of chunk... | 831 | 269 |
import sys
import time
import urllib2
from bs4 import BeautifulSoup
def parseData(url):
req=urllib2.urlopen(url)
data=req.read()
soup=BeautifulSoup(data,from_encoding='utf-8')
target=soup.find(id='sharebonus_1')
if target is None:
return None
tds=target.find('tbody').find_all('td')
result=[]
tmp=[]
for i,td... | 1,052 | 513 |
# coding=utf-8
from vxhunter_core import *
from vxhunter_utility.symbol import *
from vxhunter_utility.common import *
from ghidra.util.task import TaskMonitor
# For https://github.com/VDOO-Connected-Trust/ghidra-pyi-generator
try:
from ghidra_builtins import *
except Exception as err:
pass
try:
vx_ver... | 2,292 | 682 |
import io
from django.db.models import QuerySet
from django.shortcuts import reverse
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from xlsxwriter import Workbook
from applications.models import SummerVoucher
from common.utils import getattr_nested
FIELDS = (
# Field ti... | 8,457 | 3,188 |
"""
Data
====
Load, preprocess and filted data.
"""
from .constants import *
from .dataset import *
from .generator import *
from .preprocessing import *
from .utils import * | 177 | 54 |
# -*- coding: utf-8 -*-
"""Class resolvers that require external imports."""
| 78 | 27 |
from starsessions import SessionMiddleware
from kupala.application import Kupala
from kupala.requests import Request
from kupala.responses import JSONResponse, RedirectResponse
from kupala.routing import Route
from kupala.testclient import TestClient
async def set_view(request: Request) -> RedirectResponse:
awai... | 3,650 | 1,106 |
from fawkes.models import NetworkPoisson
import numpy as np
import time
# Continuous-Time
N = 2
T = 1000.0
dt_max = 1.00
bias = np.array([1.0, 1.0])
weights = np.array([[0.5, 0.2], [0.2, 0.5]])
mu = 0.0 * np.ones((N,N))
tau = 1.0 * np.ones((N,N))
params = {'lamb': bias, 'weights': weights, 'mu': mu, 'tau': tau}
net ... | 2,604 | 1,104 |
from menu.models import Menu_Item
def menu(request):
return {"menu_items": Menu_Item.objects.iterator()}
| 110 | 33 |
# ----------------------------------------------------------------------
# AuthProfileModel
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Python modu... | 834 | 229 |
import requests
def get_session():
s = requests.Session()
s.headers.update({
'user-agent': 'Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36'
})
return s | 266 | 116 |
from collections import defaultdict
from typing import Callable
import traceback
import aiohttp
import asyncio
import logging
import psutil
HEADERS = {"Content-Type": "application/json"}
STAT_ENDPOINT = "https://api.statcord.com/v3/stats"
def _get_package_name(obj: object) -> str:
return obj.__module__.split("."... | 6,638 | 1,994 |
from django import forms
from captcha.fields import CaptchaField
class CaptchaForm(forms.Form):
captcha = CaptchaField()
| 127 | 37 |
from copy import copy
import sqlalchemy as sa
from sqlalchemy_utils.functions import primary_keys, declarative_base
from .expression_reflector import ClassExpressionReflector
from .version import VersionClassBase
class ModelBuilder(object):
"""
VersionedModelBuilder handles the building of History models base... | 6,706 | 1,660 |
from django.db.backends.oracle.base import (
DatabaseWrapper as OracleDatabaseWrapper,
)
from .features import DatabaseFeatures
from .introspection import OracleIntrospection
from .operations import OracleOperations
from .schema import OracleGISSchemaEditor
class DatabaseWrapper(OracleDatabaseWrapper):... | 532 | 149 |
import six
from collections import abc
from ..containers import Dict, List, Tuple
from ..core import typecheck_promote, Proxytype
from ..primitives import Float, Int, Str, Bool
from ..proxify import proxify
from ..function import Function
class BandsMixin:
def __init__(self):
raise TypeError("Please use... | 10,726 | 3,190 |
#
# Copyright 2019 Alexander Fasching
#
# This program 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.
#
# This program is distributed ... | 2,594 | 842 |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 14,712 | 4,530 |
import hashlib
import itertools
from collections import OrderedDict
from analyzere import LayerView
from graphviz import Digraph
try:
from IPython.display import FileLink
_in_notebook = True
except ImportError:
_in_notebook = False
from sys import float_info
# 12 distinct colors for colorizing edges
col... | 19,847 | 5,262 |
import faiss
import json
from semantic_similarity.utility import Utility
import semantic_similarity.kypher as kypher
config = json.load(open('semantic_similarity/config.json'))
class FAISS_Index(object):
# make the actual index objects a singleton, so we don't load them multiple times:
_index = None
_q... | 3,922 | 1,224 |
import os
from babel import Locale, localedata
from babel.core import LOCALE_ALIASES
from pylons import config
from pylons import i18n
import ckan.i18n
LOCALE_ALIASES['pt'] = 'pt_BR' # Default Portuguese language to
# Brazilian territory, since
# we don't... | 3,372 | 1,016 |
#!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 3,258 | 1,021 |
from __future__ import unicode_literals
from django.contrib import admin
class VoteAdmin(admin.ModelAdmin):
date_hierarchy = 'created'
list_display = ['token', 'rate', 'article']
list_filter = ('rate',)
search_fields = ['article__title']
| 261 | 80 |
import pybullet as p
import pybullet_data as pd
import os
p.connect(p.DIRECT)
name_in = "/home/rajat/sbpl_ws/src/TMOMO/models/007_tuna_fish_can/textured_simple.obj"
name_out = "textured_simple_vhacd.obj"
name_log = "log.txt"
p.vhacd(name_in, name_out, name_log)
| 263 | 119 |
import machine
import utime
import urandom
pressed = False
led = machine.Pin(15, machine.Pin.OUT)
left_button = machine.Pin(14, machine.Pin.IN, machine.Pin.PULL_DOWN)
right_button = machine.Pin(16, machine.Pin.IN, machine.Pin.PULL_DOWN)
fastest_button = None
def button_handler(pin):
global pressed
if not pr... | 842 | 308 |
# seeder will create sample database
from app.database_setup import DBSession, Category, Item, User
session = DBSession()
# Create Demo User
user = User(name='Admin', email='webmaster@example.com')
session.add(user)
session.commit()
# Mobile brands Catalog
brand = Category(name='Samsung', user=user)
session.add(bra... | 1,981 | 606 |
#!/usr/bin/env python
import sys, os, argparse
import pandas as pd
from natsort import natsorted
class colr:
GRN = '\033[92m'
END = '\033[0m'
WARN = '\033[93m'
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter):
def __init__(self,prog):
super(MyFormatter,self).__init__(prog,max_help_p... | 3,169 | 1,247 |
class Group():
def __init__(self, connector, org_id):
self.connector = connector
self.org_id = org_id
self.base_url = 'https://api.devicemagic.com/api/v2/organizations/' \
'{0}/groups'.format(self.org_id)
self.headers = {'Content-Type': 'application/json'}
... | 1,637 | 496 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Denys Duchier, IUT d'Orléans
#==============================================================================
from .event import Event2
from .info import InfoEvent
class EnterPortalEvent(Event2):
NAME = "enter-portal"
@property
def exit(self):
return ... | 3,084 | 940 |
from typing import Iterable, Set, Any # noqa
import prefect
class RunConfig:
"""
Base class for RunConfigs.
A "run config" is an object for configuring a flow run, which maps to a
specific agent backend.
Args:
- env (dict, optional): Additional environment variables to set
- la... | 2,248 | 602 |
'''
Subselecting DataFrames with lists
You can use lists to select specific row and column labels with the .loc[] accessor. In this exercise, your job is to select the counties ['Philadelphia', 'Centre', 'Fulton'] and the columns ['winner','Obama','Romney'] from the election DataFrame, which has been pre-loaded for yo... | 1,072 | 322 |
import os
from src.configreader import ConfigReader
from src.dataset import Dataset
from src.autoencoder import Autoencoder
if __name__ == "__main__":
config_path = os.path.join(os.path.dirname(__file__), "config.json")
config_obj = ConfigReader(config_path)
dataset = Dataset(config_obj)
x_train = ... | 1,120 | 384 |
import tempfile
def generate_workfolder() -> tempfile.TemporaryDirectory:
"""Generates a workfolder
Returns:
tempfile.TemporaryDirectory: the temporary directory generated
"""
temp_dir = tempfile.TemporaryDirectory()
return temp_dir
def delete_workfolder(directory: tempfile.T... | 515 | 152 |
# -*- coding: utf-8 -*-
"""This module defines the graphical display of the models using opengl
This file is heaviliy based on the sample provided by Dr Gabor.
"""
import sys
import numpy as np
from matplotlib import cm
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
# Constants, Global... | 6,083 | 2,458 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Filename: trigger.py
# Purpose: Python trigger/picker routines for seismology.
# Author: Moritz Beyreuther, Tobias Megies
# Email: moritz.beyreuther@geophysik.uni-muenchen.de
#
# Copyright (C) 200... | 31,233 | 9,955 |
import unittest
import numpy as np
import os
MyDir=os.path.dirname(__file__)
from scipy.integrate import solve_ivp
from welib.airfoils.Polar import Polar
from welib.airfoils.DynamicStall import *
# --------------------------------------------------------------------------------}
# ---
# --------------------------... | 6,187 | 2,504 |
# -*- coding: utf-8 -*-
"""
Capture function
----------------------------------
"""
import sys
try:
from cStringIO import StringIO
except:
from io import StringIO
def capture(func, *args, **kwds):
sys.stdout = StringIO() # capture output
out = func(*args, **kwds)
out = sys.stdout.getvalue() ... | 419 | 139 |
from __future__ import annotations
import numpy as np
import numpy.linalg as lin
import networkx as nx
import scipy
import scipy.sparse.linalg as slin
import matplotlib.pyplot as plt
# Linear algebra
def specNorm(A: np.matrix) -> float:
return lin.norm(A, ord=2)
# return np.sqrt(slin.eigs(A.T @ A, k=1, which=... | 8,203 | 2,949 |
import os
import sys
backend_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../backend")
import_path = os.path.join(backend_path, "tacotron2")
sys.path.insert(0, import_path)
from .tacotron import Tacotron2Wrapper
sys.path.pop(0)
import_path = os.path.join(backend_path, "waveglow")
sys.path.insert(... | 389 | 151 |
# Copyright Niantic 2019. Patent Pending. All rights reserved.
#
# This software is licensed under the terms of the Monodepth2 licence
# which allows for non-commercial use only, the full terms of which are made
# available in the LICENSE file.
from __future__ import absolute_import, division, print_function
import o... | 25,218 | 6,076 |
import os
import cdflib
import pickle
from radynpy.cdf.auxtypes import Val, Array
import numpy as np
cdfFile = '/data/crisp/RadynGrid/radyn_out.val3c_d3_1.0e11_t20s_10kev_fp'
res = {}
cdf = cdflib.CDF(cdfFile)
for k in cdf.cdf_info()['zVariables']:
var = cdf.varget(k)
if len(var.shape) == 0:
# When t... | 780 | 323 |
# import stuff
from placerg.funcs import *
from placerg.funcsrg import *
from placerg.funcsall import *
from placerg.objects import *
from placerg.funcsboot import *
from placerg.runfunc import *
name_all='variables/loop_stim10e-16.0etvaryph1.0p1.0t0.1plNonebp0.5.pkl'
name_sum='variables/sum_stim10e-16.0etvaryph1.0p1.... | 577 | 298 |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... | 6,444 | 2,119 |
#
# @lc app=leetcode id=374 lang=python3
#
# [374] Guess Number Higher or Lower
#
# https://leetcode.com/problems/guess-number-higher-or-lower/description/
#
# algorithms
# Easy (40.73%)
# Likes: 295
# Dislikes: 1414
# Total Accepted: 126.8K
# Total Submissions: 309.9K
# Testcase Example: '10\n6'
#
# We are play... | 1,303 | 498 |
# author: Luca Marini
from stellargraph import StellarGraph
from stellargraph import datasets
import networkx as nx # https://networkx.org/documentation/stable/tutorial.html
import numpy as np
import pandas as pd
import json
from networkx.readwrite import json_graph
from LoadGraphs.load_graph_from_edges import get_no... | 6,294 | 2,069 |
import argparse
import vapoursynth as vs
from acsuite import eztrim
def main():
parser = argparse.ArgumentParser(description = "A simple command line utility for trimming audio losslessly.")
parser.add_argument("-e", "--end_frame", type = int, nargs = 1, metavar = "end_frame", default = None, help = "las... | 1,338 | 447 |
# Generated by Django 3.0.5 on 2020-08-15 09:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainApp', '0004_auto_20200815_1215'),
]
operations = [
migrations.AddField(
model_name='videolessons',
name='emb_url... | 576 | 203 |
from django.urls import path
from django.views.generic.base import TemplateView
from .views import DashboardView
urlpatterns = [
path('', TemplateView.as_view(template_name='home.html'), name='home'),
path('dashboard/', DashboardView.as_view(), name='dashboard'),
]
| 277 | 86 |
# -*- coding: utf-8 -*-
import sys
from helpers import waitForUrlChange, pageLoadWait
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
# Gloabl css selectors
inputContainerClass = 'ga-search-input-cont... | 8,432 | 2,802 |
from ode4jax._src.base import *
| 32 | 13 |
import random
import pandas as pd
import io
import json
from dateutil import parser
from collections import OrderedDict, deque
import time
import csv
import difflib
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import os
import sys, traceback
from matplotlib.legend_handler import HandlerLine2D
im... | 49,146 | 15,783 |
from ssa_sim_v2.policies.policy import Policy
from ssa_sim_v2.simulator.action import Action, ActionSet
from ssa_sim_v2.simulator.attribute import AttrSet
from ssa_sim_v2.simulator.state import StateSet
class Policy2019(Policy):
"""
Base class for 2019 simulator policy (for students)
:ivar StateSet state... | 6,350 | 1,868 |
from mysql.connector import MySQLConnection,Error
from configparser import ConfigParser
class Database:
"""Database Related Operation
Methods
--------
1.insert(data)
2.read_db_config(filename,section)
Objcet Creation
--------------
db=Database(table_name='crawler',fields=... | 3,077 | 795 |
class Hex:
def __init__(self):
self.x = 0
self.y = 0
self.text = ""
self.notes = ""
self.icons = []
| 147 | 55 |
from unittest import TestCase
from pipeline.pipeline import pipeline, inspect
class Plain:
pass
def add_age(item):
item.age = 22
return item
def add_name(name):
def fun(item):
item.name = name
return item
return fun
class AddHeight:
def __init__(self, height):
self.h... | 796 | 246 |
from python_justclick.justclick import JustClickConnection
from django.conf import settings
justClickConnection = JustClickConnection(settings.JUSTCLICK_USERNAME, settings.JUSTCLICK_API_KEY)
| 193 | 55 |
#Uses python3
import sys
from queue import LifoQueue
sys.setrecursionlimit(200000)
def explore(u, visited, adj, q, message, n_compartments):
# previsit
if message == 'running on un-reversed graph':
visited[u] = n_compartments
if message == 'running on reversed graph':
visited[u] = 1
... | 1,857 | 627 |
from setuptools import setup
setup(
name='abletondrumrack',
version='1.0.1',
author='Daniel Kavoulakos',
author_email='dan_kavoulakos@hotmail.com',
description='Create Ableton Live 11 Drum Rack presets.',
license='MIT',
packages=['.abletondrumrack'],
package_data={'.abletondrumrack': ['ableton_files/*']},
... | 444 | 179 |
import ctypes
from ctypes import wintypes
from crypt_interface.driver_interfaces.exceptions import DriverException
from crypt_interface.driver_interfaces.win import win_constants
def ctl_code(device_type, func, method, access):
""" Equivalent of:
CTL_CODE (DEVICE, FUNC, METHOD, ACCESS))
"""
return (... | 4,948 | 1,537 |
# -*- coding: UTF-8 -*-
#a = False
a = (1>0) or (-1>0) #False
print(a)
if not a :
print('True')
else:
print('False')
| 130 | 65 |
while True:
print('Hesap Makinesi İşleme Hazırdır.')
try:
print('Toplama: 1\nÇıkarma: 2\nÇarpma: 3\nBölme: 4\nÜs Alma: 5')
islem = int(input('İşlem Seçiniz: '))
if islem == 1:
print('Toplama İşlemini Seçtiniz.')
sayi1 = int(input('1. Sayıyı Giriniz: '))
... | 1,530 | 648 |
def maxSubArrayLen(nums, k):
n = len(nums)
seen = {}
maxlen = -float('inf')
total = 0
for end in range(n):
total += nums[end]
if total == k:
maxlen = end+1
if total-k in seen:
maxlen = max(maxlen, end-seen[total-k])
if total not in seen:
... | 784 | 331 |
"""Tests for getters."""
from napalm.base.test.getters import BaseTestGetters
import pytest
@pytest.mark.usefixtures("set_device_parameters")
class TestGetter(BaseTestGetters):
"""Test get_* methods."""
@pytest.mark.skip
def test_get_interfaces(self, test_case):
"""Need to implement."""
... | 2,007 | 661 |
# Copyright (c) 2015 OpenStack Foundation.
# 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... | 19,121 | 5,243 |
from __future__ import absolute_import
import requests
import zipfile
import errno
import os
import json
import datetime
from edrlog import EDRLog
import utils2to3
EDRLOG = EDRLog()
class EDRAutoUpdater(object):
REPO = "lekeno/edr"
UPDATES = utils2to3.abspathmaker(__file__, 'updates')
LATEST = utils2to3.... | 3,418 | 1,138 |
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import cv2 as cv
class fig_Dialog(QThread):
def __init__(self, img_path, window_name, parent=None):
super(fig_Dialog, self).__init__()
self.img_path = img_path
self.windowname = window_name
def __del__(se... | 1,839 | 679 |